When the smart contact will be deployed, I want to send some tokens to another wallet, by smart contract.
Is there some way to do that?
1 Answer
Example:
pragma solidity ^0.4.19; contract Demo { uint public constant INITIAL_SUPPLY = 1000000000; mapping (address => uint) public balances; function Demo() public { balances[msg.sender] = INITIAL_SUPPLY - 1000; balances[address(0)] = 1000; } } Replace address(0) with some real address which you want to send your tokens
or you can pass address on contract deployment:
function Demo(address _address) public { balances[msg.sender] = INITIAL_SUPPLY - 1000; balances[_address] = 1000; } - I get an issue. I try this way but again get "Warning: This looks like an address but has an invalid checksum"Arri– Arri2018-02-01 20:01:12 +00:00Commented Feb 1, 2018 at 20:01
- balanceOf[0x14723a09acff6d2a60dcdf7aa4aff308fddc160c] = 140000000;Arri– Arri2018-02-01 20:01:16 +00:00Commented Feb 1, 2018 at 20:01
- @ArikDonowan Solidity: How to specify a (hard-coded) address as a literalRoman Frolov– Roman Frolov2018-02-01 20:07:11 +00:00Commented Feb 1, 2018 at 20:07