mirror of
				https://github.com/0glabs/0g-chain.git
				synced 2025-11-04 03:17:27 +00:00 
			
		
		
		
	feat: IWrappedA0GIBase
This commit is contained in:
		
							parent
							
								
									2fa73957a9
								
							
						
					
					
						commit
						e2668ad80d
					
				
							
								
								
									
										51
									
								
								precompiles/interfaces/contracts/IWrappedA0GIBase.sol
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										51
									
								
								precompiles/interfaces/contracts/IWrappedA0GIBase.sol
									
									
									
									
									
										Normal file
									
								
							@ -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;
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user