PreKlimaTokenUpgradeableChild
Inherits: ERC20PresetFixedSupplyUpgradeable, OwnableUpgradeable
State Variables
requireSellerApproval
bool public requireSellerApproval;
allowMinting
bool public allowMinting;
childChainManagerProxy
address public childChainManagerProxy;
isApprovedSeller
mapping(address => bool) public isApprovedSeller;
Functions
constructor
constructor();
initializeChild
function initializeChild(address _Klimadmin, address _childChainManagerProxy) public initializer;
__PreKlimaTokenUpgradeableChild_init
function __PreKlimaTokenUpgradeableChild_init(address _Klimadmin, address _childChainManagerProxy)
internal
initializer;
allowOpenTrading
function allowOpenTrading() external onlyOwner returns (bool);
disableMinting
function disableMinting() external onlyOwner returns (bool);
_addApprovedSeller
function _addApprovedSeller(address approvedSeller_) internal;
addApprovedSeller
function addApprovedSeller(address approvedSeller_) external onlyOwner returns (bool);
addApprovedSellers
function addApprovedSellers(address[] calldata approvedSellers_) external onlyOwner returns (bool);
_removeApprovedSeller
function _removeApprovedSeller(address disapprovedSeller_) internal;
removeApprovedSeller
function removeApprovedSeller(address disapprovedSeller_) external onlyOwner returns (bool);
removeApprovedSellers
function removeApprovedSellers(address[] calldata disapprovedSellers_) external onlyOwner returns (bool);
_beforeTokenTransfer
function _beforeTokenTransfer(address from_, address to_, uint256 amount_) internal override;
mint
function mint(address recipient_, uint256 amount_) public virtual onlyOwner;
deposit
called when token is deposited on root chain
Should be callable only by ChildChainManager Should handle deposit by minting the required amount for user Make sure minting is done only by this function
function deposit(address user, bytes calldata depositData) external;
Parameters
Name | Type | Description |
---|---|---|
user | address | user address for whom deposit is being done |
depositData | bytes | abi encoded amount |
withdraw
called when user wants to withdraw tokens back to root chain
Should burn user's tokens. This transaction will be verified when exiting on root chain
function withdraw(uint256 amount) external;
Parameters
Name | Type | Description |
---|---|---|
amount | uint256 | amount of tokens to withdraw |