LNKS
Test dApp
- Run
./smarttestrpc.sh
- Import 3 created accounts to Metamask via private key
- Open
truffle console
- Run
LNKSToken.deployed().then(function(instance) {token=instance;})
- Mint some tokens
token.mint(web3.eth.accounts[0],100)
- From new terminal window go to
/frontend
folder and runnpm start
. - If you have Metamask enabled, you will see account address and its balance
Test token
Setup
- LNKSToken.deployed().then(function(instance) {token=instance;})
- LNKSExchange.deployed().then(function(instance) {exchange=instance;})
- let acc;
- web3.eth.getAccounts((err, res) => acc = res[0])
- token.mint(acc,100)
- exchange.setTokenAddress(token.address)
- token.addOwner(exchange.address)
Buy direct
- exchange.buyDirect({from: acc, value: web3.toWei(0.11, 'ether')})
- exchange.getOrdersLength.call()
- exchange.getOrder.call(0)
- Assume 1 ETH = 100 TOKENS (7.77 ETH = 777 TOKENS)
- exchange.approveOrder(0, 777)
- token.balanceOf(web3.eth.accounts[1])
Redeem
- exchange.redeem(50, 'random address')
- exchange.getRedemptionsLength()
Deployment on Rinkeby
truffle migrate --network rinkeby --reset