This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.6.4; | |
contract Token { | |
... | |
... | |
mapping(address => uint) public balanceOf; | |
event Transfer(address indexed _from, address indexed _to, uint256 _value); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.6.4; | |
contract Token { | |
... | |
... | |
mapping(address => uint) public balanceOf; | |
event Transfer(address indexed _from, address indexed _to, uint256 _value); | |
function transfer(address _to, uint _value) public returns (bool success) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.6.4; | |
contract Token { | |
uint public totalSupply; | |
mapping(address => uint) public balanceOf; | |
constructor(uint _totalSupply) { | |
totalSupply = _totalSupply; | |
balance[msg.sender] = _totalSupply; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.6.4; | |
contract Token { | |
uint public totalSupply; | |
constructor(uint _totalSupply) { | |
totalSupply = _totalSupply; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.6.4; | |
contract Token { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.6.4; | |
contract Token { | |
uint public decimals = 18; | |
string public symbol = 'AT'; | |
string public name = 'Agoi Token'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
networks: { | |
development: { | |
host: "127.0.0.1", // Localhost (default: none) | |
port: 7545, // Standard Ethereum port (default: none) | |
network_id: "*", // Any network (default: none) | |
}, | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.5.3; | |
contract Mapping { | |
mapping(address => uint) balances; | |
mapping(address => mapping(address => bool)) approved; | |
function manipulateMapOfMap(spender) external { | |
approved[msg.sender][spender] = true //assign a value to the approved map | |
approved[msg.sender][spender]; //get the value of the map |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.5.3; | |
contract Mapping { | |
mapping(address => uint[]) scores; | |
function manipulateArrayMap() external { | |
scores[msg.sender].push(1); //assign a value; | |
scores[msg.sender].push(2); //assign another element | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.5.3; | |
contract Mapping { | |
mapping(address => uint) balances; | |
function manipulateMap() external { | |
balances[msg.sender] = 100; //assign a value; | |
balances[msg.sender] //read a value; |
NewerOlder