Last active
June 7, 2018 08:13
-
-
Save shingonu/a4d0d2778472c36c2f2409b775d21e49 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| web3.eth.accounts | |
| const owner = web3.eth.accounts[0] | |
| owner | |
| moment = require('moment') | |
| const expireDates = [moment().add(100, 'minutes').unix(), moment().add(200, 'minutes').unix(),] | |
| let token1, token2 | |
| HanwhaToken.new('HanwhaToken1', 'HWT1', '18', expireDates, {from: owner}).then(instance => token1 = instance) | |
| HanwhaToken.new('HanwhaToken2', 'HWT2', '18', expireDates, {from: owner}).then(instance => token2 = instance) | |
| // testToken = HanwhaToken.at(token1.address) | |
| let swapper | |
| HanwhaTokenSwapper.new({from: owner}).then(instance => swapper = instance) | |
| token1.mint(web3.eth.accounts[1], 1000, {from: owner}); | |
| token2.mint(web3.eth.accounts[2], 1000, {from: owner}); | |
| token1.balanceOf(web3.eth.accounts[1]) | |
| token2.balanceOf(web3.eth.accounts[2]) | |
| token1.addSwapperRole(swapper.address, {from: owner}) | |
| token2.addSwapperRole(swapper.address, {from: owner}) | |
| swapper.swap(token1.address, token2.address, web3.eth.accounts[1], web3.eth.accounts[2], 500, 1000, 500, {from: owner}) | |
| token1.balanceOf(web3.eth.accounts[1]) | |
| token1.balanceOf(web3.eth.accounts[2]) | |
| token2.balanceOf(web3.eth.accounts[1]) | |
| token2.balanceOf(web3.eth.accounts[2]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment