11. ERC-20
ERC-20 has emerged as the technical standard; it is
used for all smart contracts on the Ethereum
blockchain for token implementation and provides a
list of rules that all Ethereum-based tokens must
follow.
FUNCTIONS
• totalSupply()
• balanceOf(account)
• transfer(recipient, amount)
• allowance(owner, spender)
• approve(spender, amount)
• transferFrom(sender, recipient, amount)
EVENTS
• Transfer(from, to, value)
• Approval(owner, spender, value)
15. OPENZEPPELIN CONTRACTS
TOKENS TOKENS
ACCESS
CONTROLS
FINANCE GOVERNANCE
META
TRANSACTION
OpenZeppelin Contracts is a library for secure smart contract development. It provides
implementations of standards like ERC20 and ERC721 which you can deploy as-is or extend to
suit your needs, as well as Solidity components to build custom contracts and more complex
decentralized systems.
16. OPENZEPPELIN BENEFITS
Open-source (MIT License)
Implementations of standards like ERC20 and ERC721.
Flexible role-based permissioning scheme.
Reusable Solidity components to build custom contracts and
complex decentralized systems.
First-class integration with the Gas Station Network for systems
with no gas fees!
Audited by leading security firms
19. WHY REMIX?
•Ethereum integration
•Blockchain emulator
•Remix can support both Solidity and Viper
•Many plugin related to smart contract development,
testing, and documentation
•Visual debugger
•Selection of compiler version
30. STAY IN TOUCH
Gene Leybzon https://www.linkedin.com/in/leybzon/
https://www.meetup.com/members/90744
20/
https://www.leybzon.com
Editor's Notes
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
/**
* @title Storage
* @dev Store & retrieve value in a variable
*/
contract Storage {
uint256 number;
/**
* @dev Store value in variable
* @param num value to store
*/
function store(uint256 num) public {
number = num;
}
/**
* @dev Return value
* @return value of 'number'
*/
function retrieve() public view returns (uint256){
return number;
}
}
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
/**
* @title Storage
* @dev Store & retrieve value in a variable
*/
contract Storage {
uint256 number;
/**
* @dev Store value in variable
* @param num value to store
*/
function store(uint256 num) public {
number = num;
}
/**
* @dev Return value
* @return value of 'number'
*/
function retrieve() public view returns (uint256){
return number;
}
}
1. how tokens can be transferred by its owner?
2. how tokens can be transferred on behalf of an owner?
3. how to get data about the token?
4. events about the token