合約代幣流動性質押挖礦開發(節點做市)丨合約代幣流動性質押挖礦系統開發詳細

xiaofufu發表於2023-03-10

隨著技術的不斷進步,智慧手機的普及情況加深,移動網際網路的盈利模式不斷擴大和成熟,可以想象未來的移動網際網路市場前景更廣闊,規模也會逐漸超越傳統網際網路。移動網際網路引發的市場多元化,一方面讓原有的市場變得更加垂直縱深,一方面是讓大市場和小市場並存。當然傳統網際網路還是不可被取代,傳統網際網路如果能與移動網際網路很好地融合,移動網際網路帶動傳統網際網路發展,將會是一個美好的願景。


function div(uint256 a, uint256 b) internal constant returns (uint256) {

    // assert(b > 0); // Solidity automatically throws when dividing by 0

    uint256 c = a / b;

    // assert(a == b * c + a % b); // There is no case in which this doesn't hold

    return c;

  }


  function sub(uint256 a, uint256 b) internal constant returns (uint256) {

    assert(b <= a);

    return a - b;

  }


  function add(uint256 a, uint256 b) internal constant returns (uint256) {

    uint256 c = a + b;

    assert(c >= a);

    return c;

  }

  function toUINT112(uint256 a) internal constant returns(uint112) {

    assert(uint112(a) == a);

    return uint112(a);

  }


  function toUINT120(uint256 a) internal constant returns(uint120) {

    assert(uint120(a) == a);

    return uint120(a);

  }


  function toUINT128(uint256 a) internal constant returns(uint128) {

    assert(uint128(a) == a);

    return uint128(a);

  }

}規則及案例:MrsFu123



// Abstract contract for the full ERC 20 Token standard

//


contract Token {

    /* This is a slight change to the ERC20 base standard.

    function totalSupply() constant returns (uint256 supply);

    is replaced with:

    uint256 public totalSupply;

    This automatically creates a getter function for the totalSupply.

    This is moved to the base contract since public getter functions are not

    currently recognised as an implementation of the matching abstract

    function by the compiler.

    */

    /// total amount of tokens

    //uint256 public totalSupply;

    function totalSupply() constant returns (uint256 supply);


    /// @param _owner The address from which the balance will be retrieved

    /// @return The balance

    function balanceOf(address _owner) constant returns (uint256 balance);


    /// @notice send `_value` token to `_to` from `msg.sender`

    /// @param _to The address of the recipient

    /// @param _value The amount of token to be transferred

    /// @return Whether the transfer was successful or not

    function transfer(address _to, uint256 _value) returns (bool success);


    /// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`

    /// @param _from The address of the sender

    /// @param _to The address of the recipient

    /// @param _value The amount of token to be transferred

    /// @return Whether the transfer was successful or not

    function transferFrom(address _from, address _to, uint256 _value) returns (bool success);


    /// @notice `msg.sender` approves `_addr` to spend `_value` tokens

    /// @param _spender The address of the account able to transfer the tokens

    /// @param _value The amount of wei to be approved for transfer

    /// @return Whether the approval was successful or not

    function approve(address _spender, uint256 _value) returns (bool success);


    /// @param _owner The address of the account owning tokens

    /// @param _spender The address of the account able to transfer the tokens

    /// @return Amount of remaining tokens allowed to spent

    function allowance(address _owner, address _spender) constant returns (uint256 remaining);


    event Transfer(address indexed _from, address indexed _to, uint256 _value);

    event Approval(address indexed _owner, address indexed _spender, uint256 _value);

}



/// VEN token, ERC20 compliant

contract VEN is Token, Owned {

    using SafeMath for uint256;


    string public constant name    = "VeChain Token";  //The Token's name

    uint8 public constant decimals = 18;               //Number of decimals of the smallest unit

    string public constant symbol  = "VEN";            //An identifier    


    // packed to 256bit to save gas usage.

    struct Supplies {

        // uint128's max value is about 3e38.

        // it's enough to present amount of tokens

        uint128 total;

        uint128 rawTokens;

    }


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/69956839/viewspace-2939013/,如需轉載,請註明出處,否則將追究法律責任。

相關文章