Update docs
This commit is contained in:
31
docs/modules/api/examples/governance/MyTokenWrapped.sol
Normal file
31
docs/modules/api/examples/governance/MyTokenWrapped.sol
Normal file
@ -0,0 +1,31 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.2;
|
||||
|
||||
import "@openzeppelin/contracts/../token/ERC20/ERC20.sol";
|
||||
import "@openzeppelin/contracts/../token/ERC20/extensions/ERC20Permit.sol";
|
||||
import "@openzeppelin/contracts/../token/ERC20/extensions/ERC20Votes.sol";
|
||||
import "@openzeppelin/contracts/../token/ERC20/extensions/ERC20Wrapper.sol";
|
||||
|
||||
contract MyTokenWrapped is ERC20, ERC20Permit, ERC20Votes, ERC20Wrapper {
|
||||
constructor(
|
||||
IERC20 wrappedToken
|
||||
) ERC20("MyTokenWrapped", "MTK") ERC20Permit("MyTokenWrapped") ERC20Wrapper(wrappedToken) {}
|
||||
|
||||
// The functions below are overrides required by Solidity.
|
||||
|
||||
function decimals() public pure override(ERC20, ERC20Wrapper) returns (uint8) {
|
||||
return 18;
|
||||
}
|
||||
|
||||
function _afterTokenTransfer(address from, address to, uint256 amount) internal override(ERC20, ERC20Votes) {
|
||||
super._afterTokenTransfer(from, to, amount);
|
||||
}
|
||||
|
||||
function _mint(address to, uint256 amount) internal override(ERC20, ERC20Votes) {
|
||||
super._mint(to, amount);
|
||||
}
|
||||
|
||||
function _burn(address account, uint256 amount) internal override(ERC20, ERC20Votes) {
|
||||
super._burn(account, amount);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user