WeuFoundDev / Governance-token-contracts

Governance contract of INPUT (INT) | A development based minting tokens for developers and researchers ecosystem.
GNU General Public License v3.0
2 stars 0 forks source link

Write a minting contract Which will be created for every protocol that we are building in burning contract and the maxsupply of that minting contract as the total investment of the protocol in the burning contract #21

Closed shivasai780 closed 1 year ago

shivasai780 commented 1 year ago

@shivasai780 @sscodez @123456788940 @vinaykumar0103 @Adityapandey59

shivasai780 commented 1 year ago
pragma solidity ^0.8.16;

import "./Iint.sol";

contract Minting  {

    uint public MaxSupply;
    uint public PresentSupply;
    address public BurningAddress;
    mapping(address => uint) public Devamount;
    address public WeuFoundation;
    Iint public intToken;
    address public ProtocolAddress;
    modifier OnlyBurning(){
        require(msg.sender == BurningAddress,"The sender needs to be burning address");
        _;
    }
    modifier OnlyFoundation(){
        require(msg.sender == WeuFoundation,"The sender needs to be WeuFoundation address");
        _;
    }
    constructor(){
        BurningAddress = msg.sender;
    }
    function initialize(uint _supply,address _weuFoundation,address _intToken,address _protocol)external OnlyBurning{
        require(ProtocolAddress == address(0),"The Protocol is already initialized");
        MaxSupply=_supply;
        WeuFoundation=_weuFoundation;
        intToken=Iint(_intToken);
        ProtocolAddress =_protocol;
      }
    function InceaseMaxSupply(uint _supply)external OnlyBurning{
        require(_supply!=0,"The supply cannot be equal to zero ");
         MaxSupply += _supply;
    } 
    function mintSupply(uint _supply,address _dev)external OnlyFoundation  {
        require(_supply !=0 && _dev!=address(0),"The supply amount cannot be equal to zero and _dev address should not be equal to zero address");
        require(MaxSupply >= (PresentSupply+_supply));
         intToken.mint(_dev, _supply);
         PresentSupply += _supply;
    }

}
sscodez commented 1 year ago
pragma solidity ^0.8.16;

import "./Iint.sol";

contract Minting  {

    uint public MaxSupply;
    uint public PresentSupply;
    address public BurningAddress;
    mapping(address => uint) public Devamount;
    address public WeuFoundation;
    Iint public intToken;
    address public ProtocolAddress;
    modifier OnlyBurning(){
        require(msg.sender == BurningAddress,"The sender needs to be burning address");
        _;
    }
    modifier OnlyFoundation(){
        require(msg.sender == WeuFoundation,"The sender needs to be WeuFoundation address");
        _;
    }
    constructor(){
        BurningAddress = msg.sender;
    }
    function initialize(uint _supply,address _weuFoundation,address _intToken,address _protocol)external OnlyBurning{
        MaxSupply=_supply;
        WeuFoundation=_weuFoundation;
        intToken=Iint(_intToken);
        ProtocolAddress =_protocol;
      }
    function IncreaseMaxSupply(uint _supply)external OnlyBurning{
        require(_supply!=0,"The supply cannot be equal to zero ");
         MaxSupply += _supply;
    } 
    function mintSupply(uint _supply,address _dev)external OnlyFoundation  {
        require(_supply !=0 && _dev!=address(0),"The supply amount cannot be equal to zero and _dev address should not be equal to zero address");
          require(MaxSupply >= (PresentSupply + _supply), "Exceeds the maximum supply");
         intToken.mint(_dev, _supply);
         PresentSupply += _supply;
    }

}
vinaykumar0103 commented 1 year ago
contract Minting {
    uint public MaxSupply;
    uint public PresentSupply;
    address public BurningAddress;
    mapping(address => uint) public Devamount;
    address public WeuFoundation;
    IERC20 public intToken;
    address public ProtocolAddress;
    modifier OnlyBurning() {
        require(msg.sender == BurningAddress, "The sender needs to be burning address");
        _;
    }
    modifier OnlyFoundation() {
        require(msg.sender == WeuFoundation, "The sender needs to be WeuFoundation address");
        _;
    }
    constructor() {
        BurningAddress = msg.sender;
    }
    function initialize(uint _supply, address _weuFoundation, address _intToken, address _protocol) external OnlyBurning {
        MaxSupply = _supply;
        WeuFoundation = _weuFoundation;
        intToken = IERC20(_intToken);
        ProtocolAddress = _protocol;
    }
    function InceaseMaxSupply(uint _supply) external OnlyBurning {
        require(_supply != 0, "The supply cannot be equal to zero ");
        MaxSupply += _supply;
    }
    function mintSupply(uint _supply, address _dev) external OnlyFoundation {
        require(_supply != 0 && _dev != address(0), "The supply amount cannot be equal to zero and _dev address should not be equal to zero address");
        require(MaxSupply >= (PresentSupply + _supply));
        intToken.mint(_dev, _supply);
        PresentSupply += _supply;
    }
    function getAvailableSupply() external view returns (uint256) {
        return MaxSupply - PresentSupply;
    }
}

// function getAvailableSupply() external view returns (uint256) { return MaxSupply - PresentSupply; } //

123456788940 commented 1 year ago

// SPDX-License-Identifier: MIT pragma solidity ^0.8.0;

import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

contract MintingContract is Ownable { enum Role {Researcher, Developer, NonTech}

struct User {
    Role role;
    uint256 mintedTokens;
    bool isVerified;
}

struct Protocol {
    uint256 maxSupply;
    uint256 totalInvestment;
    address burningContractAddress;
}

mapping(address => User) public users;
mapping(address => mapping(address => Protocol)) public protocols;
mapping(address => uint256) public stakedTokens;

IERC20 public governanceToken;
string public Token="INPUT";
string public symbol="INT";

event TokensMinted(address indexed user, Role role, uint256 amount);
event ProofOfIdentitySubmitted(address indexed user);
event PullRequestSubmitted(address indexed user, bytes32 pullRequestId);
event TokensStaked(address indexed user, uint256 amount);
event TokensBurned(address indexed user, uint256 amount);

modifier onlyVerifiedUser() {
    require(users[msg.sender].isVerified, "User not verified");
    _;
}

constructor(address _governanceTokenAddress) {
    governanceToken = IERC20(_governanceTokenAddress);
}

function createProtocol(address _protocolAddress, uint256 _maxSupply, uint256 _totalInvestment, address _burningContractAddress) external onlyOwner {
    protocols[msg.sender][_protocolAddress] = Protocol(_maxSupply, _totalInvestment, _burningContractAddress);
}

function mintTokens(Role _role, address _protocolAddress, uint amount) external {
    Protocol storage protocol = protocols[msg.sender][_protocolAddress];
    require(protocol.maxSupply > 0, "Protocol not found");
    require(_role == Role.Researcher || _role == Role.Developer || _role == Role.NonTech, "Invalid role");
    require(amount>=0,"must be as per said");
    emit TokensMinted(msg.sender, _role, amount);
}

function submitProofOfIdentity(bytes calldata ) external {
    users[msg.sender].isVerified = true;
    emit ProofOfIdentitySubmitted(msg.sender);
}

function submitPullRequest(bytes32 _pullRequestId) external onlyVerifiedUser {
    require(_pullRequestId!=bytes32(0));
    emit PullRequestSubmitted(msg.sender, _pullRequestId);
}

function setProtocolMaxSupply(address _protocolAddress, uint256 _maxSupply) external onlyOwner { Protocol storage protocol = protocols[msg.sender][_protocolAddress]; require(protocol.totalInvestment > 0, "Protocol not found"); protocol.maxSupply = _maxSupply; }

}

123456788940 commented 1 year ago

// SPDX-License-Identifier: MIT pragma solidity ^0.8.0;

contract minting { address public owner; uint256 public totalSupply; uint256 public burningPool; // INT set aside for minting for a particular protocol uint256 public timechain; // Number of remaining timechains uint256 public timechainDuration; // Duration of each timechain in seconds mapping(address => uint256) public balanceOf; mapping(address => uint256) public burnedAmount; mapping(address => string) public zkId; mapping(address => bool) public isFixedAlphaContributor; // Changed "isCoreDev" to "isFixedAlphaContributor" mapping(address => bool) public isVariableSeagullContributor; // Changed "isVarDev" to "isVariableSeagullContributor" mapping(address => bool) public isGrantRecipient; // Added mapping for grant recipients

event Minted(address indexed account, uint256 amount);
event Burned(address indexed account, uint256 amount);
event Stake(address indexed account, uint256 amount);
event Unstake(address indexed account, uint256 amount);

constructor(uint256 initialSupply) {
    owner = msg.sender;
    totalSupply = initialSupply;
    balanceOf[msg.sender] = initialSupply;
    burningPool = 0;
    timechain = 50;
    timechainDuration = 7 days; // Set the duration of each timechain to 7 days
}

modifier onlyOwner() {
    require(msg.sender == owner, "Only the contract owner can call this function");
    _;
}

modifier onlyFixedAlphaContributor() { // Changed "onlyCoreDev" to "onlyFixedAlphaContributor"
    require(isFixedAlphaContributor[msg.sender], "Only FIXED |Alpha| contributors can call this function");
    _;
}

modifier onlyVariableSeagullContributor() { // Changed "onlyDev" to "onlyVariableSeagullContributor"
    require(isVariableSeagullContributor[msg.sender], "Only VARIABLE |seagull| contributors can call this function");
    _;
}

modifier onlyContributor() {
    require(isFixedAlphaContributor[msg.sender] || isVariableSeagullContributor[msg.sender] || isGrantRecipient[msg.sender], "Only contributors can call this function");
    _;
}

function mint(uint256 amount, string memory zkIdString) public {
    require(amount > 0, "Amount must be greater than 0");

    totalSupply += amount;
    balanceOf[msg.sender] += amount;
    zkId[msg.sender] = zkIdString;

    emit Minted(msg.sender, amount);
}

function burn(uint256 amount) public {
    require(amount > 0, "Amount must be greater than 0");
    require(balanceOf[msg.sender] >= amount, "Insufficient balance");

    totalSupply -= amount;
    balanceOf[msg.sender] -= amount;
    burnedAmount[msg.sender] += amount;

    emit Burned(msg.sender, amount);
}

function setFixedAlphaContributor(address account, bool status) public onlyOwner {
    isFixedAlphaContributor[account] = status;
}

function setVariableSeagullContributor(address account, bool status) public onlyOwner {
    isVariableSeagullContributor[account] = status;
}

function setGrantRecipient(address account, bool status) public onlyOwner {
    isGrantRecipient[account] = status;
}

function mintINTForProtocol(uint256 amount) public onlyContributor {
    require(amount > 0, "Amount must be greater than 0");
    require(timechain > 0, "No more timechains available for minting");

    require(block.timestamp % timechainDuration == 0, "Cannot mint INT until the current timechain is completed");

    uint256 slashAmount = amount / 50; // 2% slash from the minting pool
    burningPool += slashAmount;
    timechain--;

    totalSupply += amount;
    balanceOf[msg.sender] += amount;
    emit Minted(msg.sender, amount);
}

}

Adityapandey59 commented 1 year ago

pragma solidity ^0.8.16;

import "./Iint.sol";

contract EnhancedMinting { uint public maxSupply; uint public presentSupply; address public burningAddress; mapping(address => uint) public devAmount; address public weuFoundation; Iint public intToken; address public protocolAddress;

modifier onlyBurning() {
    require(msg.sender == burningAddress, "The sender needs to be the burning address");
    _;
}

modifier onlyFoundation() {
    require(msg.sender == weuFoundation, "The sender needs to be the WeuFoundation address");
    _;
}

constructor(uint _maxSupply) {
    maxSupply = _maxSupply;
    burningAddress = msg.sender;
}

function initialize(
    address _weuFoundation,
    address _intToken,
    address _protocol
) external onlyBurning {
    require(protocolAddress == address(0), "The Protocol is already initialized");
    weuFoundation = _weuFoundation;
    intToken = Iint(_intToken);
    protocolAddress = _protocol;
}

function increaseMaxSupply(uint _supply) external onlyBurning {
    require(_supply != 0, "The supply cannot be equal to zero ");
    maxSupply += _supply;
}

function mintSupply(uint _supply, address _dev) external onlyFoundation {
    require(_supply != 0 && _dev != address(0), "The supply amount and _dev address cannot be zero");
    require(maxSupply >= (presentSupply + _supply), "Exceeded maximum supply");
    intToken.mint(_dev, _supply);
    presentSupply += _supply;
}

function burn(uint _amount) external onlyBurning {
    require(_amount <= presentSupply, "Cannot burn more than the present supply");
    presentSupply -= _amount;
    intToken.burn(address(this), _amount);
}

}

WeuFoundDev commented 1 year ago

There in total 6 contracts which one have to be initiated for the testnet branch . Select one and close the rest one as it look the copy of some contracts out there @shivasai780 @vinaykumar0103 @123456788940