Address Contract Partially Verified
Address
0xF09F3788743C18ecDc2cF238163bd0bbBc8A4FD8
Balance
0 ETH
Nonce
1
Code Size
4052 bytes
Creator
0xAf592460...B502 at tx 0x65d47b81...97423d
Indexed Transactions
0
Contract Bytecode
4052 bytes
0x606060405236156100ef576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630fb5a6b4146100f457806313d033c01461011d57806338af3eed1461014657806344b1231f1461019b5780635b940081146101c457806363d256ce146101ed57806386d1a69f1461021a578063872a78101461022f5780638da5cb5b1461025c57806396132521146102b1578063980c2f21146102da578063b6549f751461031c578063be9a655514610331578063d1fb56461461035a578063dc07065714610393578063f2fde38b146103cc578063fc0c546a14610405575b600080fd5b34156100ff57600080fd5b61010761045a565b6040518082815260200191505060405180910390f35b341561012857600080fd5b610130610460565b6040518082815260200191505060405180910390f35b341561015157600080fd5b610159610466565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156101a657600080fd5b6101ae61048c565b6040518082815260200191505060405180910390f35b34156101cf57600080fd5b6101d7610624565b6040518082815260200191505060405180910390f35b34156101f857600080fd5b610200610648565b604051808215151515815260200191505060405180910390f35b341561022557600080fd5b61022d61065b565b005b341561023a57600080fd5b61024261069a565b604051808215151515815260200191505060405180910390f35b341561026757600080fd5b61026f6106ad565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156102bc57600080fd5b6102c46106d2565b6040518082815260200191505060405180910390f35b34156102e557600080fd5b61031a600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506106d8565b005b341561032757600080fd5b61032f61087e565b005b341561033c57600080fd5b610344610ad3565b6040518082815260200191505060405180910390f35b341561036557600080fd5b610391600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ad9565b005b341561039e57600080fd5b6103ca600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610b54565b005b34156103d757600080fd5b610403600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610c1c565b005b341561041057600080fd5b610418610d73565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60045481565b60025481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b151561055657600080fd5b6102c65a03f1151561056757600080fd5b50505060405180519050915061058860065483610d9990919063ffffffff16565b905060025442101561059d576000925061061f565b6105b4600454600354610d9990919063ffffffff16565b421015806105ce5750600560019054906101000a900460ff165b156105db5780925061061f565b6106166004546106086105f960035442610db890919063ffffffff16565b84610dd290919063ffffffff16565b610e0690919063ffffffff16565b925061061f565b5b5b505090565b600061064260065461063461048c565b610db890919063ffffffff16565b90505b90565b600560019054906101000a900460ff1681565b600254421015151561066c57600080fd5b610697600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610e22565b5b565b600560009054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60065481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561073357600080fd5b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415151561079057600080fd5b8173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b151561085c57600080fd5b6102c65a03f1151561086d57600080fd5b50505060405180519050505b5b5050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156108d957600080fd5b600560009054906101000a900460ff1615156108f457600080fd5b600560019054906101000a900460ff1615151561091057600080fd5b61093b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610e22565b610a886000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b1515610a2557600080fd5b6102c65a03f11515610a3657600080fd5b50505060405180519050600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ed49092919063ffffffff16565b6001600560016101000a81548160ff0219169083151502179055507f44825a4b2df8acb19ce4e1afba9aa850c8b65cdb7942e2078f27d0b0960efee660405160405180910390a15b5b565b60035481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b3557600080fd5b6002544210151515610b4657600080fd5b610b4f81610e22565b5b5b50565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610bb057600080fd5b60008173ffffffffffffffffffffffffffffffffffffffff1614151515610bd657600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b5b50565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c7757600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610cb357600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b5b50565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000808284019050838110151515610dad57fe5b8091505b5092915050565b6000828211151515610dc657fe5b81830390505b92915050565b60008082840290506000841480610df35750828482811515610df057fe5b04145b1515610dfb57fe5b8091505b5092915050565b6000808284811515610e1457fe5b0490508091505b5092915050565b6000610e2c610624565b9050610e4381600654610d9990919063ffffffff16565b600681905550610e968282600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ed49092919063ffffffff16565b7ffb81f9b30d73d830c3544b34d827c08142579ee75710b490bab0b3995468c5656006546040518082815260200191505060405180910390a15b5050565b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515610f7f57600080fd5b6102c65a03f11515610f9057600080fd5b505050604051805190501515610fa257fe5b5b5050505600a165627a7a72305820df0b56fe19f134f932ec473cd4c04694e892ddb5a895e65e55fc4778dd4a0ba20029
Verified Source Code Partial Match
Compiler: v0.4.13+commit.0fb4cb1a
Optimization: No
TokenVesting.sol 338 lines
pragma solidity ^0.4.13;
library Math {
function max64(uint64 a, uint64 b) internal constant returns (uint64) {
return a >= b ? a : b;
}
function min64(uint64 a, uint64 b) internal constant returns (uint64) {
return a < b ? a : b;
}
function max256(uint256 a, uint256 b) internal constant returns (uint256) {
return a >= b ? a : b;
}
function min256(uint256 a, uint256 b) internal constant returns (uint256) {
return a < b ? a : b;
}
}
library SafeMath {
function mul(uint256 a, uint256 b) internal constant returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
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;
}
}
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @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 public {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public constant returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public constant returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeERC20 {
function safeTransfer(ERC20Basic token, address to, uint256 value) internal {
assert(token.transfer(to, value));
}
function safeTransferFrom(ERC20 token, address from, address to, uint256 value) internal {
assert(token.transferFrom(from, to, value));
}
function safeApprove(ERC20 token, address spender, uint256 value) internal {
assert(token.approve(spender, value));
}
}
contract ReturnVestingRegistry is Ownable {
mapping (address => address) public returnAddress;
function record(address from, address to) onlyOwner public {
require(from != 0);
returnAddress[from] = to;
}
}
contract TerraformReserve is Ownable {
/* Storing a balance for each user */
mapping (address => uint256) public lockedBalance;
/* Store the total sum locked */
uint public totalLocked;
/* Reference to the token */
ERC20 public manaToken;
/* Contract that will assign the LAND and burn/return tokens */
address public landClaim;
/* Prevent the token from accepting deposits */
bool public acceptingDeposits;
event LockedBalance(address user, uint mana);
event LandClaimContractSet(address target);
event LandClaimExecuted(address user, uint value, bytes data);
event AcceptingDepositsChanged(bool _acceptingDeposits);
function TerraformReserve(address _token) {
require(_token != 0);
manaToken = ERC20(_token);
acceptingDeposits = true;
}
/**
* Lock MANA into the contract.
* This contract does not have another way to take the tokens out other than
* through the target contract.
*/
function lockMana(address _from, uint256 mana) public {
require(acceptingDeposits);
require(mana >= 1000 * 1e18);
require(manaToken.transferFrom(_from, this, mana));
lockedBalance[_from] += mana;
totalLocked += mana;
LockedBalance(_from, mana);
}
/**
* Allows the owner of the contract to pause acceptingDeposits
*/
function changeContractState(bool _acceptingDeposits) public onlyOwner {
acceptingDeposits = _acceptingDeposits;
AcceptingDepositsChanged(acceptingDeposits);
}
/**
* Set the contract that can move the staked MANA.
* Calls the `approve` function of the ERC20 token with the total amount.
*/
function setTargetContract(address target) public onlyOwner {
landClaim = target;
manaToken.approve(landClaim, totalLocked);
LandClaimContractSet(target);
}
/**
* Prevent payments to the contract
*/
function () public payable {
revert();
}
}
contract TokenVesting is Ownable {
using SafeMath for uint256;
using SafeERC20 for ERC20;
event Released(uint256 amount);
event Revoked();
// beneficiary of tokens after they are released
address public beneficiary;
uint256 public cliff;
uint256 public start;
uint256 public duration;
bool public revocable;
bool public revoked;
uint256 public released;
ERC20 public token;
/**
* @dev Creates a vesting contract that vests its balance of any ERC20 token to the
* _beneficiary, gradually in a linear fashion until _start + _duration. By then all
* of the balance will have vested.
* @param _beneficiary address of the beneficiary to whom vested tokens are transferred
* @param _cliff duration in seconds of the cliff in which tokens will begin to vest
* @param _duration duration in seconds of the period in which the tokens will vest
* @param _revocable whether the vesting is revocable or not
* @param _token address of the ERC20 token contract
*/
function TokenVesting(
address _beneficiary,
uint256 _start,
uint256 _cliff,
uint256 _duration,
bool _revocable,
address _token
) {
require(_beneficiary != 0x0);
require(_cliff <= _duration);
beneficiary = _beneficiary;
start = _start;
cliff = _start.add(_cliff);
duration = _duration;
revocable = _revocable;
token = ERC20(_token);
}
/**
* @notice Only allow calls from the beneficiary of the vesting contract
*/
modifier onlyBeneficiary() {
require(msg.sender == beneficiary);
_;
}
/**
* @notice Allow the beneficiary to change its address
* @param target the address to transfer the right to
*/
function changeBeneficiary(address target) onlyBeneficiary public {
require(target != 0);
beneficiary = target;
}
/**
* @notice Transfers vested tokens to beneficiary.
*/
function release() public {
require(now >= cliff);
_releaseTo(beneficiary);
}
/**
* @notice Transfers vested tokens to a target address.
* @param target the address to send the tokens to
*/
function releaseTo(address target) onlyBeneficiary public {
require(now >= cliff);
_releaseTo(target);
}
/**
* @notice Transfers vested tokens to beneficiary.
*/
function _releaseTo(address target) internal {
uint256 unreleased = releasableAmount();
released = released.add(unreleased);
token.safeTransfer(target, unreleased);
Released(released);
}
/**
* @notice Allows the owner to revoke the vesting. Tokens already vested are sent to the beneficiary.
*/
function revoke() onlyOwner public {
require(revocable);
require(!revoked);
// Release all vested tokens
_releaseTo(beneficiary);
// Send the remainder to the owner
token.safeTransfer(owner, token.balanceOf(this));
revoked = true;
Revoked();
}
/**
* @dev Calculates the amount that has already vested but hasn't been released yet.
*/
function releasableAmount() public constant returns (uint256) {
return vestedAmount().sub(released);
}
/**
* @dev Calculates the amount that has already vested.
*/
function vestedAmount() public constant returns (uint256) {
uint256 currentBalance = token.balanceOf(this);
uint256 totalBalance = currentBalance.add(released);
if (now < cliff) {
return 0;
} else if (now >= start.add(duration) || revoked) {
return totalBalance;
} else {
return totalBalance.mul(now.sub(start)).div(duration);
}
}
/**
* @notice Allow withdrawing any token other than the relevant one
*/
function releaseForeignToken(ERC20 _token, uint256 amount) onlyOwner {
require(_token != token);
_token.transfer(owner, amount);
}
}
Write Contract 17 functions
These functions modify contract state and require a wallet transaction to execute.
beneficiary 0x38af3eed
No parameters
returns: address
changeBeneficiary 0xdc070657
address target
cliff 0x13d033c0
No parameters
returns: uint256
duration 0x0fb5a6b4
No parameters
returns: uint256
owner 0x8da5cb5b
No parameters
returns: address
releasableAmount 0x5b940081
No parameters
returns: uint256
release 0x86d1a69f
No parameters
releaseForeignToken 0x980c2f21
address _token
uint256 amount
releaseTo 0xd1fb5646
address target
released 0x96132521
No parameters
returns: uint256
revocable 0x872a7810
No parameters
returns: bool
revoke 0xb6549f75
No parameters
revoked 0x63d256ce
No parameters
returns: bool
start 0xbe9a6555
No parameters
returns: uint256
token 0xfc0c546a
No parameters
returns: address
transferOwnership 0xf2fde38b
address newOwner
vestedAmount 0x44b1231f
No parameters
returns: uint256
Recent Transactions
No transactions found for this address