From e2668ad80ddba3c9eaad7b0e3cdace5ba31be86e Mon Sep 17 00:00:00 2001 From: MiniFrenchBread <103425574+MiniFrenchBread@users.noreply.github.com> Date: Fri, 3 Jan 2025 14:51:07 +0800 Subject: [PATCH] feat: IWrappedA0GIBase --- .../interfaces/contracts/IWrappedA0GIBase.sol | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 precompiles/interfaces/contracts/IWrappedA0GIBase.sol diff --git a/precompiles/interfaces/contracts/IWrappedA0GIBase.sol b/precompiles/interfaces/contracts/IWrappedA0GIBase.sol new file mode 100644 index 00000000..e5a9aa7a --- /dev/null +++ b/precompiles/interfaces/contracts/IWrappedA0GIBase.sol @@ -0,0 +1,51 @@ +// SPDX-License-Identifier: LGPL-3.0-only +pragma solidity >=0.8.0; + +/** + * @title WrappedA0GIBase is a precompile for wrapped a0gi(wA0GI), it enables wA0GI mint/burn native 0g token directly. + */ +interface IWrappedA0GIBase { + struct Supply { + uint256 cap; + uint256 total; + } + + /** + * @dev set the wA0GI address. + * It is designed to be called by governance module only so it's not implemented at EVM precompile side. + * @param + */ + // function setWA0GI(address addr) external; + + /** + * @dev set the cap for a minter. + * It is designed to be called by governance module only so it's not implemented at EVM precompile side. + * @param minter minter address + * @param cap mint cap + */ + // function setMinterCap(address minter, uint256 cap) external; + + /** + * @dev get the mint supply of given address + * @param minter minter address + */ + function minterSupply(address minter) external view returns (Supply memory); + + /** + * @dev mint a0gi to given address directly, add corresponding amount to minter's mint supply. + * If sender's final mint supply exceeds its mint cap, the transaction will revert. + * Can only be called by + * + * @param minter minter address + * @param to recipient address + * @param amount amount to mint + */ + function mint(address minter, address to, uint256 amount) external; + + /** + * @dev burn given amount of a0gi on behalf of minter, reduce corresponding amount from sender's mint supply. + * @param minter minter address + * @param amount amount to burn + */ + function burn(address minter, uint256 amount) external; +}