-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathexample_run.js
More file actions
32 lines (22 loc) · 966 Bytes
/
Copy pathexample_run.js
File metadata and controls
32 lines (22 loc) · 966 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
const Sample = artifacts.require("Sample");
module.exports = async (callback) => {
const sampleInstance = await Sample.deployed()
var accounts = await web3.eth.getAccounts()
var newBal = await web3.eth.getBalance(accounts[0])
console.log(sampleInstance.address)
console.log(newBal)
var result = await sampleInstance.addNums1(50, 1)
console.log(result.toString())
var result = await sampleInstance.rectangle(50, 1)
console.log(result.s.toString())
console.log(result.p.toString())
var result = await sampleInstance.getBalanceOwn()
console.log(result.toString())
var newBal = await web3.eth.getBalance(accounts[0]);
console.log(newBal.toString());
var res = await sampleInstance.getBalance();
console.log(res.toString())
var res = await sampleInstance.sendContractEther(1, 3, 7000, {
from: accounts[0], value: web3.utils.toWei('1', 'ether')
})
}