0


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?

Roman Frolov
  • 3,177
  • 2
  • 11
  • 29
Arri
  • 135
  • 1
  • 1
  • 6

1 Answers1

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