Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
constructor() public {
        symbol = "STT";
        name = "Sample Token";
        decimals = 18; 

    totalSupply_ = 500000000 * (10 ** uint256(decimals));
    // Now we need to split the total supply into 2 hardcoded addresses

//my pseudo code idea function allocate() public {

}

//my pseudo code idea 
function allocate() public {
    allocations[0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA] = 250000000 * (10 ** uint256(decimals));
       
    allocations[0xBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB] = 250000000 * (10 ** uint256(decimals)); 
    }
contract SampleToken is PausableToken {
    string public constant name = "Sample Token"; 
    string public constant symbol = "STT";
    uint256 public constant decimals = 18;

    mapping (address => uint256) freezes;

    /* This notifies clients about the amount burnt */
    event Burn(address indexed from, uint256 value);
    
    /* This notifies clients about the amount frozen */
    event Freeze(address indexed from, uint256 value);
    
    /* This notifies clients about the amount unfrozen */
    event Unfreeze(address indexed from, uint256 value);

    constructor() public {
        totalSupply_ = 500000000 * (10 ** uint256(decimals));
        balances[msg.sender] = totalSupply_;

// we need to split the total supply to two or more addresses

        // we need to split the total supply to two or more addresses 
    }
    
    function freezeOf(address _owner) public view returns (uint256) {
        return freezes[_owner];
    }

    function burn(uint256 _value) whenNotPaused public returns (bool) {
        require(_value <= balances[msg.sender]);
        
        balances[msg.sender] = balances[msg.sender].sub(_value);
        totalSupply_ = totalSupply_.sub(_value);
        emit Burn(msg.sender, _value);
        return true;
    }
    
    function freeze(uint256 _value) whenNotPaused public returns (bool) {
        require(_value <= balances[msg.sender]);
        
        balances[msg.sender] = balances[msg.sender].sub(_value);
        freezes[msg.sender] = freezes[msg.sender].add(_value);
        emit Freeze(msg.sender, _value);
        return true;
    }
    
    function unfreeze(uint256 _value) whenNotPaused public returns (bool) {
        require(_value <= freezes[msg.sender]);
        
        freezes[msg.sender] = freezes[msg.sender].sub(_value);
        balances[msg.sender] = balances[msg.sender].add(_value);
        emit Unfreeze(msg.sender, _value);
        return true;
    }
    
    /**
    * @dev Allows the current owner to transfer control of the contract to a newOwner.
    * @param newOwner The address to transfer ownership to.
    */
    function transferOwnership(address newOwner) onlyOwner whenNotPaused public {
        super.transferOwnership(newOwner);
    }

    /**
    * The fallback function.
    */
    function() payable external {
        revert();
    }
}
constructor() public {
        symbol = "STT";
        name = "Sample Token";
        decimals = 18; 

totalSupply_ = 500000000 * (10 ** uint256(decimals));
    // Now we need to split the total supply into 2 hardcoded addresses

//my pseudo code idea function allocate() public {

    allocations[0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA] = 250000000 * (10 ** uint256(decimals));
       
    allocations[0xBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB] = 250000000 * (10 ** uint256(decimals)); 
    }
contract SampleToken is PausableToken {
    string public constant name = "Sample Token"; 
    string public constant symbol = "STT";
    uint256 public constant decimals = 18;

    mapping (address => uint256) freezes;

    /* This notifies clients about the amount burnt */
    event Burn(address indexed from, uint256 value);
    
    /* This notifies clients about the amount frozen */
    event Freeze(address indexed from, uint256 value);
    
    /* This notifies clients about the amount unfrozen */
    event Unfreeze(address indexed from, uint256 value);

    constructor() public {
        totalSupply_ = 500000000 * (10 ** uint256(decimals));
        balances[msg.sender] = totalSupply_;

// we need to split the total supply to two or more addresses

    }
    
    function freezeOf(address _owner) public view returns (uint256) {
        return freezes[_owner];
    }

    function burn(uint256 _value) whenNotPaused public returns (bool) {
        require(_value <= balances[msg.sender]);
        
        balances[msg.sender] = balances[msg.sender].sub(_value);
        totalSupply_ = totalSupply_.sub(_value);
        emit Burn(msg.sender, _value);
        return true;
    }
    
    function freeze(uint256 _value) whenNotPaused public returns (bool) {
        require(_value <= balances[msg.sender]);
        
        balances[msg.sender] = balances[msg.sender].sub(_value);
        freezes[msg.sender] = freezes[msg.sender].add(_value);
        emit Freeze(msg.sender, _value);
        return true;
    }
    
    function unfreeze(uint256 _value) whenNotPaused public returns (bool) {
        require(_value <= freezes[msg.sender]);
        
        freezes[msg.sender] = freezes[msg.sender].sub(_value);
        balances[msg.sender] = balances[msg.sender].add(_value);
        emit Unfreeze(msg.sender, _value);
        return true;
    }
    
    /**
    * @dev Allows the current owner to transfer control of the contract to a newOwner.
    * @param newOwner The address to transfer ownership to.
    */
    function transferOwnership(address newOwner) onlyOwner whenNotPaused public {
        super.transferOwnership(newOwner);
    }

    /**
    * The fallback function.
    */
    function() payable external {
        revert();
    }
}
constructor() public {
    symbol = "STT";
    name = "Sample Token";
    decimals = 18; 

    totalSupply_ = 500000000 * (10 ** uint256(decimals));
    // Now we need to split the total supply into 2 hardcoded addresses
}

//my pseudo code idea 
function allocate() public {
    allocations[0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA] = 250000000 * (10 ** uint256(decimals));
    allocations[0xBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB] = 250000000 * (10 ** uint256(decimals)); 
}
contract SampleToken is PausableToken {
    string public constant name = "Sample Token"; 
    string public constant symbol = "STT";
    uint256 public constant decimals = 18;

    mapping (address => uint256) freezes;

    /* This notifies clients about the amount burnt */
    event Burn(address indexed from, uint256 value);
    
    /* This notifies clients about the amount frozen */
    event Freeze(address indexed from, uint256 value);
    
    /* This notifies clients about the amount unfrozen */
    event Unfreeze(address indexed from, uint256 value);

    constructor() public {
        totalSupply_ = 500000000 * (10 ** uint256(decimals));
        balances[msg.sender] = totalSupply_;
        // we need to split the total supply to two or more addresses 
    }
    
    function freezeOf(address _owner) public view returns (uint256) {
        return freezes[_owner];
    }

    function burn(uint256 _value) whenNotPaused public returns (bool) {
        require(_value <= balances[msg.sender]);
        
        balances[msg.sender] = balances[msg.sender].sub(_value);
        totalSupply_ = totalSupply_.sub(_value);
        emit Burn(msg.sender, _value);
        return true;
    }
    
    function freeze(uint256 _value) whenNotPaused public returns (bool) {
        require(_value <= balances[msg.sender]);
        
        balances[msg.sender] = balances[msg.sender].sub(_value);
        freezes[msg.sender] = freezes[msg.sender].add(_value);
        emit Freeze(msg.sender, _value);
        return true;
    }
    
    function unfreeze(uint256 _value) whenNotPaused public returns (bool) {
        require(_value <= freezes[msg.sender]);
        
        freezes[msg.sender] = freezes[msg.sender].sub(_value);
        balances[msg.sender] = balances[msg.sender].add(_value);
        emit Unfreeze(msg.sender, _value);
        return true;
    }
    
    /**
    * @dev Allows the current owner to transfer control of the contract to a newOwner.
    * @param newOwner The address to transfer ownership to.
    */
    function transferOwnership(address newOwner) onlyOwner whenNotPaused public {
        super.transferOwnership(newOwner);
    }

    /**
    * The fallback function.
    */
    function() payable external {
        revert();
    }
}
added 6 characters in body; edited title
Source Link
eonic
  • 11
  • 4

Initial ERC20 Token supply split into 2 or more hardcoded addresses with token allocation

don't know if someone can help me, but let me explain my problem. For more transparency in my ERC20 token generation smart contract, I want to hardcode the Team Pool (0xA) and Crowdfunding Pool (0xB) with allocation amounts, just as example.

Initial supply split into 2 hardcoded addresses with token allocation

don't know if someone can help me, but let me explain my problem. For more transparency in my token generation smart contract, I want to hardcode the Team Pool (0xA) and Crowdfunding Pool (0xB) with allocation amounts, just as example.

Initial ERC20 Token supply split into 2 or more hardcoded addresses

don't know if someone can help me, but let me explain my problem. For more transparency in my ERC20 token generation smart contract, I want to hardcode the Team Pool (0xA) and Crowdfunding Pool (0xB) with allocation amounts, just as example.

added 2596 characters in body
Source Link
eonic
  • 11
  • 4
constructor() public {
        symbol = "STT";
        name = "Sample Token";
        decimals = 18; 

totalSupply_ = 500000000 * (10 ** uint256(decimals));
    // Now we need to split the total supply into 2 hardcoded addresses
 
    function allocate() public {
          

//my pseudo code idea function allocate() public {

    allocations[0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA] = 250000000 * (10 ** uint256(decimals));
       
    allocations[0xBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB] = 250000000 * (10 ** uint256(decimals)); 
    }

Cheers

contract SampleToken is PausableToken {
    string public constant name = "Sample Token"; 
    string public constant symbol = "STT";
    uint256 public constant decimals = 18;

    mapping (address => uint256) freezes;

    /* This notifies clients about the amount burnt */
    event Burn(address indexed from, uint256 value);
    
    /* This notifies clients about the amount frozen */
    event Freeze(address indexed from, uint256 value);
    
    /* This notifies clients about the amount unfrozen */
    event Unfreeze(address indexed from, uint256 value);

    constructor() public {
        totalSupply_ = 500000000 * (10 ** uint256(decimals));
        balances[msg.sender] = totalSupply_;

// we need to split the total supply to two or more addresses

    }
    
    function freezeOf(address _owner) public view returns (uint256) {
        return freezes[_owner];
    }

    function burn(uint256 _value) whenNotPaused public returns (bool) {
        require(_value <= balances[msg.sender]);
        
        balances[msg.sender] = balances[msg.sender].sub(_value);
        totalSupply_ = totalSupply_.sub(_value);
        emit Burn(msg.sender, _value);
        return true;
    }
    
    function freeze(uint256 _value) whenNotPaused public returns (bool) {
        require(_value <= balances[msg.sender]);
        
        balances[msg.sender] = balances[msg.sender].sub(_value);
        freezes[msg.sender] = freezes[msg.sender].add(_value);
        emit Freeze(msg.sender, _value);
        return true;
    }
    
    function unfreeze(uint256 _value) whenNotPaused public returns (bool) {
        require(_value <= freezes[msg.sender]);
        
        freezes[msg.sender] = freezes[msg.sender].sub(_value);
        balances[msg.sender] = balances[msg.sender].add(_value);
        emit Unfreeze(msg.sender, _value);
        return true;
    }
    
    /**
    * @dev Allows the current owner to transfer control of the contract to a newOwner.
    * @param newOwner The address to transfer ownership to.
    */
    function transferOwnership(address newOwner) onlyOwner whenNotPaused public {
        super.transferOwnership(newOwner);
    }

    /**
    * The fallback function.
    */
    function() payable external {
        revert();
    }
}
constructor() public {
        symbol = "STT";
        name = "Sample Token";
        decimals = 18; 

totalSupply_ = 500000000 * (10 ** uint256(decimals));
    // Now we need to split the total supply into 2 hardcoded addresses
 
    function allocate() public {
          
    allocations[0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA] = 250000000 * (10 ** uint256(decimals));
       
    allocations[0xBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB] = 250000000 * (10 ** uint256(decimals)); 
    }

Cheers

constructor() public {
        symbol = "STT";
        name = "Sample Token";
        decimals = 18; 

totalSupply_ = 500000000 * (10 ** uint256(decimals));
    // Now we need to split the total supply into 2 hardcoded addresses

//my pseudo code idea function allocate() public {

    allocations[0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA] = 250000000 * (10 ** uint256(decimals));
       
    allocations[0xBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB] = 250000000 * (10 ** uint256(decimals)); 
    }

Cheers

contract SampleToken is PausableToken {
    string public constant name = "Sample Token"; 
    string public constant symbol = "STT";
    uint256 public constant decimals = 18;

    mapping (address => uint256) freezes;

    /* This notifies clients about the amount burnt */
    event Burn(address indexed from, uint256 value);
    
    /* This notifies clients about the amount frozen */
    event Freeze(address indexed from, uint256 value);
    
    /* This notifies clients about the amount unfrozen */
    event Unfreeze(address indexed from, uint256 value);

    constructor() public {
        totalSupply_ = 500000000 * (10 ** uint256(decimals));
        balances[msg.sender] = totalSupply_;

// we need to split the total supply to two or more addresses

    }
    
    function freezeOf(address _owner) public view returns (uint256) {
        return freezes[_owner];
    }

    function burn(uint256 _value) whenNotPaused public returns (bool) {
        require(_value <= balances[msg.sender]);
        
        balances[msg.sender] = balances[msg.sender].sub(_value);
        totalSupply_ = totalSupply_.sub(_value);
        emit Burn(msg.sender, _value);
        return true;
    }
    
    function freeze(uint256 _value) whenNotPaused public returns (bool) {
        require(_value <= balances[msg.sender]);
        
        balances[msg.sender] = balances[msg.sender].sub(_value);
        freezes[msg.sender] = freezes[msg.sender].add(_value);
        emit Freeze(msg.sender, _value);
        return true;
    }
    
    function unfreeze(uint256 _value) whenNotPaused public returns (bool) {
        require(_value <= freezes[msg.sender]);
        
        freezes[msg.sender] = freezes[msg.sender].sub(_value);
        balances[msg.sender] = balances[msg.sender].add(_value);
        emit Unfreeze(msg.sender, _value);
        return true;
    }
    
    /**
    * @dev Allows the current owner to transfer control of the contract to a newOwner.
    * @param newOwner The address to transfer ownership to.
    */
    function transferOwnership(address newOwner) onlyOwner whenNotPaused public {
        super.transferOwnership(newOwner);
    }

    /**
    * The fallback function.
    */
    function() payable external {
        revert();
    }
}
added 103 characters in body
Source Link
eonic
  • 11
  • 4
Loading
edited title
Link
eonic
  • 11
  • 4
Loading
Source Link
eonic
  • 11
  • 4
Loading