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?
Asked
Active
Viewed 213 times
0
Roman Frolov
- 3,177
- 2
- 11
- 29
Arri
- 135
- 1
- 1
- 6
-
can you put your SC address here – TahaBA Feb 01 '18 at 19:27
1 Answers
0
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;
}
Roman Frolov
- 3,177
- 2
- 11
- 29
-
I get an issue. I try this way but again get "Warning: This looks like an address but has an invalid checksum" – Arri Feb 01 '18 at 20:01
-
-