Open 123456788940 opened 1 year ago
Contract Variables:
maxSupply: An unsigned integer that represents the maximum total supply of the token.
presentSupply: As minting pool will be different for every entropy being build or have grants offered . But there burning address will remain the same .
burningAddress: An Ethereum address that is set during contract deployment. It represents the address authorized to trigger functions with the onlyBurning modifier. Burning contract can only investment from FRP (foundation revenue pool) and burning of INT can only be done by council members (8 members) with a quorum of 75 percent and psuedo overide address controlling it for critical time which will be the FRP pool addresses only. Burning address performs a function of checking every minting address denoting no. of timechain left and no. of int tokens can be minted out .
Foundation Revenue Pool: An Ethereum/arbritrum based address that represents the address of the Weu Foundation. It is authorized to trigger functions with the onlyFoundation modifier.
intToken: An instance of a contract implementing the int interface. It represents the token contract that complies with the minting interface. Each project/entropy will have their own minting address denoting no. of time chains and no. of int tokens.
Modifiers: onlyBurning: A custom modifier that restricts the execution of a function to be triggered only by the burningAddress defined during contract deployment. onlyFoundation: A custom modifier that restricts the execution of a function to be triggered only by the weu Foundation address.
Verifiers: A multi sig aggregation based signing for approval of minting of existing INT tokens equal to the amount of INT tokens are specified for minting for the particular job. The verifier function must be triggered by 66% percent of the total auditors/verifiers .
Constructor: The constructor sets the address of the burningAddress to be the address of the sender who deploys the contract. It also initializes the maxSupply to be existed for the specified minting pool for particular timechains.
Function initialize: This function can only be called by the burningAddress (through the onlyBurning modifier) during contract initialization with the quorum of 100 % of council members. It allows the contract owner (presumably the burning address) to set the initial values of mintSupply for the particular minting pool , no. of timechains assigned to particular minting pool , and protocolAddress. This function can be used to update these values after the contract is deployed.
Function increaseMintSupply: This function can only be called by the burningAddress (through the onlyBurning modifier) which will trigger only after all the council members signed the increaseMintSupply for the particular minting pool. It increases the maxSupply of the INT by the specified _supply amount for the specified pool . The _supply must be greater than zero. But it will increase the threshold percentage for Burning INT per TIMECHAIN as the end of 50 timechain the minting supply will reach 0.
Function mintSupply: This function can only be called by the developers and researchers after getting approval by the verifiers address for their work. Verifiers are the core devs who let the community to mint the INT tokens for their work . Before minting, the function checks if the _minting supply , _dev address and their attached id are valid .
If the checks pass, it calls the mint function on the intToken contract to mint specified tokens approved by the verifiers for the _dev address and updates the presentSupply accordingly. Overall, the contract aims to provide a controlled minting process for a token, where only the burningAddress can increase the maximum supply, and only the weuFoundation can mint new tokens to a specified address while adhering to the defined maximum supply limit.
However, please note that the contract assumes the existence of an interface called int, which should be defined in a separate file (imported as "@openzeppelin/contracts/access/Ownable.sol"). This interface likely contains a function signature for the mint function used in the mintSupply function.
@123456788940 @shivasai780 tell me more things to update .
@123456788940 Update the docs with the same contract and configure to close this branch once done
Is this branch should be closed . Configure it here n close it @123456788940 @shivasai780
Minting Smart Contract
Overview:
The Minting Smart Contract is designed to govern the process of minting new tokens within a protocol. It provides control over maximum mintable limits, tracks developer-specific minted amounts, and enforces authorization through designated addresses.
Features:
Getting Started:
Prerequisites:
To interact with the Minting Smart Contract, you'll need:
Usage:
Contract Initialization:
The contract should be deployed with the following parameters:
Maxminted
: The maximum limit of tokens that can be minted.PresentMinted
: The total number of tokens currently minted.BurningAddress
: The address authorized to perform certain burning-related actions.Devamount
: A mapping that tracks the minted amount for each developer address.WeuFoundation
: The address of the foundation overseeing the protocol.intToken
: An interface to the token contract for minting.ProtocolAddress
: The address of the protocol contract.Modifiers:
OnlyBurning()
: Restricts function execution to the authorized BurningAddress.OnlyFoundation()
: Restricts function execution to the WeuFoundation address.Constructor:
The constructor initializes the contract with the deployer's address as the initial BurningAddress.
Functions:
initialize(...)
: Initializes the protocol with initial values and addresses. This function can only be called by the BurningAddress and sets values such as Maxminted, WeuFoundation, intToken, and ProtocolAddress.
increaseMaxMinted(...)
: Allows the BurningAddress to increase the maximum limit of tokens that can be minted by a specified supply.
decreaseMaxMinted(...)
: Allows the BurningAddress to decrease the maximum limit of tokens that can be minted by a specified supply.
mintSupply(...)
: Allows the WeuFoundation to mint new tokens and assign them to a developer. This function enforces constraints and updates PresentMinted, Devamount, and the token supply.
The Minting Smart Contract ensures proper control and accountability in the minting process, keeping track of minted tokens and enforcing maximum minting limits. It provides a secure framework for managing minting activities within a protocol.
The provided smart contract is called "Minting" and it facilitates the minting of a custom token. Let's break down the contract and its components:
// SPDX-License-Identifier: MIT
: This is a SPDX license identifier that indicates the licensing of the smart contract. In this case, the MIT license is used, which is a permissive open-source license.pragma solidity ^0.8.0;
: This line specifies the version of the Solidity compiler required to compile the contract. In this case, version 0.8.0 or higher is needed.Import Statements:
import "@openzeppelin/contracts/access/Ownable.sol";
: This imports theOwnable
contract from the OpenZeppelin library. TheOwnable
contract provides a modifier that restricts certain functions to be callable only by the contract owner.import "@openzeppelin/contracts/utils/math/SafeMath.sol";
: This imports theSafeMath
library from the OpenZeppelin library. TheSafeMath
library provides safe arithmetic operations to prevent integer overflows and underflows.import "./Iint.sol";
: This imports the interfaceIint
, which defines the function signature for the minting of the custom token. This interface will be used later in the contract.Interface:
interface Iint { function mint(address to, uint256 amount) external; }
: This is the interfaceIint
, which defines a single functionmint
. The purpose of this interface is to interact with the external contract that implements this function for minting tokens.Contract Structure:
contract Minting is Ownable { ... }
: TheMinting
contract inherits from theOwnable
contract, meaning it will have the access control functionality provided byOwnable
. It is a standard practice to use access control mechanisms to manage ownership and permissions within a smart contract.State Variables:
uint256 public immutable MaxSupply;
: This variable represents the maximum supply of the custom token and is declared asimmutable
, meaning it can only be set during contract deployment and cannot be changed thereafter.uint256 public presentSupply;
: This variable keeps track of the current supply of the custom token.address public immutable BurningAddress;
: This variable stores the address that has permission to perform specific actions (defined by theonlyBurning
modifier).address public immutable WeuFoundation;
: This variable stores the address of the WeuFoundation, which is granted permission to perform specific actions (defined by theonlyFoundation
modifier).Iint public immutable intToken;
: This variable is of typeIint
, representing the interface of the contract that implements the minting function.address public immutable ProtocolAddress;
: This variable stores the address of a protocol.Modifiers:
modifier onlyBurning() { ... }
: This modifier restricts access to certain functions to theBurningAddress
.modifier onlyFoundation() { ... }
: This modifier restricts access to certain functions to theWeuFoundation
.Constructor:
constructor(uint256 _maxSupply) { ... }
: This is the constructor function that is executed once during the contract deployment. It sets theMaxSupply
and initializes theBurningAddress
with the address of the deployer.External Functions:
function initialize(uint _supply, address _weuFoundation, address _intToken, address _protocol) external OnlyBurning { ... }
: This function can be called by theBurningAddress
to initialize various parameters of the contract, such as theMaxSupply
,WeuFoundation
,intToken
, andProtocolAddress
.function increaseMaxSupply(uint256 _supply) external onlyBurning { ... }
: This function allows theBurningAddress
to increase the maximum supply by a specified amount.function mintSupply(uint256 _supply, address _dev) external onlyFoundation { ... }
: This function allows theWeuFoundation
to mint new tokens and increase the present supply.Overall, this contract is designed to handle the minting of a custom token with controlled access to specific functions. The actual minting of tokens is done through an external contract that implements the
mint
function as defined in theIint
interface. The contract enforces access control through theonlyBurning
andonlyFoundation
modifiers, ensuring that only the designated addresses can perform certain actions.As always, it's crucial to ensure that the interfaces and external contracts used in this contract are implemented securely and have been audited for potential vulnerabilities before deploying this contract to the mainnet or any production environment.