Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function buyTokenFromOwner() payable {
- require(msg.value >= price);
- if (msg.value > price) {
- msg.sender.transfer(msg.value.sub(price));
- }
- tokens[owner] = tokens[owner].sub(1);
- tokens[msg.sender] = tokens[msg.sender].add(1);
- }
- async buyToken() {
- let contractInstance = await TokenSaleContract.at(this.state.contractAddress);
- let name = await contractInstance.getName();
- await contractInstance.buyTokenFromOwner({ value: 107087936329796580 })
- }
Add Comment
Please, Sign In to add comment