Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00Latest 2 internal transactions
Advanced mode:
| Parent Transaction Hash | Method | Block |
From
|
|
To
|
||
|---|---|---|---|---|---|---|---|
| - | 7854252 | 2497 days ago | Contract Creation | 0 ETH | |||
| - | 7064286 | 2632 days ago | Contract Creation | 0 ETH |
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
NokuCustomCrowdsaleService
Compiler Version
v0.4.24+commit.e67f0147
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity)
/**
*Submitted for verification at Etherscan.io on 2018-10-12
*/
pragma solidity ^0.4.23;
// File: contracts/TokenSale.sol
contract TokenSale {
/**
* Buy tokens for the beneficiary using paid Ether.
* @param beneficiary the beneficiary address that will receive the tokens.
*/
function buyTokens(address beneficiary) public payable;
}
// File: contracts/WhitelistableConstraints.sol
/**
* @title WhitelistableConstraints
* @dev Contract encapsulating the constraints applicable to a Whitelistable contract.
*/
contract WhitelistableConstraints {
/**
* @dev Check if whitelist with specified parameters is allowed.
* @param _maxWhitelistLength The maximum length of whitelist. Zero means no whitelist.
* @param _weiWhitelistThresholdBalance The threshold balance triggering whitelist check.
* @return true if whitelist with specified parameters is allowed, false otherwise
*/
function isAllowedWhitelist(uint256 _maxWhitelistLength, uint256 _weiWhitelistThresholdBalance)
public pure returns(bool isReallyAllowedWhitelist) {
return _maxWhitelistLength > 0 || _weiWhitelistThresholdBalance > 0;
}
}
// File: contracts/Whitelistable.sol
/**
* @title Whitelistable
* @dev Base contract implementing a whitelist to keep track of investors.
* The construction parameters allow for both whitelisted and non-whitelisted contracts:
* 1) maxWhitelistLength = 0 and whitelistThresholdBalance > 0: whitelist disabled
* 2) maxWhitelistLength > 0 and whitelistThresholdBalance = 0: whitelist enabled, full whitelisting
* 3) maxWhitelistLength > 0 and whitelistThresholdBalance > 0: whitelist enabled, partial whitelisting
*/
contract Whitelistable is WhitelistableConstraints {
event LogMaxWhitelistLengthChanged(address indexed caller, uint256 indexed maxWhitelistLength);
event LogWhitelistThresholdBalanceChanged(address indexed caller, uint256 indexed whitelistThresholdBalance);
event LogWhitelistAddressAdded(address indexed caller, address indexed subscriber);
event LogWhitelistAddressRemoved(address indexed caller, address indexed subscriber);
mapping (address => bool) public whitelist;
uint256 public whitelistLength;
uint256 public maxWhitelistLength;
uint256 public whitelistThresholdBalance;
constructor(uint256 _maxWhitelistLength, uint256 _whitelistThresholdBalance) internal {
require(isAllowedWhitelist(_maxWhitelistLength, _whitelistThresholdBalance), "parameters not allowed");
maxWhitelistLength = _maxWhitelistLength;
whitelistThresholdBalance = _whitelistThresholdBalance;
}
/**
* @return true if whitelist is currently enabled, false otherwise
*/
function isWhitelistEnabled() public view returns(bool isReallyWhitelistEnabled) {
return maxWhitelistLength > 0;
}
/**
* @return true if subscriber is whitelisted, false otherwise
*/
function isWhitelisted(address _subscriber) public view returns(bool isReallyWhitelisted) {
return whitelist[_subscriber];
}
function setMaxWhitelistLengthInternal(uint256 _maxWhitelistLength) internal {
require(isAllowedWhitelist(_maxWhitelistLength, whitelistThresholdBalance),
"_maxWhitelistLength not allowed");
require(_maxWhitelistLength != maxWhitelistLength, "_maxWhitelistLength equal to current one");
maxWhitelistLength = _maxWhitelistLength;
emit LogMaxWhitelistLengthChanged(msg.sender, maxWhitelistLength);
}
function setWhitelistThresholdBalanceInternal(uint256 _whitelistThresholdBalance) internal {
require(isAllowedWhitelist(maxWhitelistLength, _whitelistThresholdBalance),
"_whitelistThresholdBalance not allowed");
require(whitelistLength == 0 || _whitelistThresholdBalance > whitelistThresholdBalance,
"_whitelistThresholdBalance not greater than current one");
whitelistThresholdBalance = _whitelistThresholdBalance;
emit LogWhitelistThresholdBalanceChanged(msg.sender, _whitelistThresholdBalance);
}
function addToWhitelistInternal(address _subscriber) internal {
require(_subscriber != address(0), "_subscriber is zero");
require(!whitelist[_subscriber], "already whitelisted");
require(whitelistLength < maxWhitelistLength, "max whitelist length reached");
whitelistLength++;
whitelist[_subscriber] = true;
emit LogWhitelistAddressAdded(msg.sender, _subscriber);
}
function removeFromWhitelistInternal(address _subscriber, uint256 _balance) internal {
require(_subscriber != address(0), "_subscriber is zero");
require(whitelist[_subscriber], "not whitelisted");
require(_balance <= whitelistThresholdBalance, "_balance greater than whitelist threshold");
assert(whitelistLength > 0);
whitelistLength--;
whitelist[_subscriber] = false;
emit LogWhitelistAddressRemoved(msg.sender, _subscriber);
}
/**
* @param _subscriber The subscriber for which the balance check is required.
* @param _balance The balance value to check for allowance.
* @return true if the balance is allowed for the subscriber, false otherwise
*/
function isAllowedBalance(address _subscriber, uint256 _balance) public view returns(bool isReallyAllowed) {
return !isWhitelistEnabled() || _balance <= whitelistThresholdBalance || whitelist[_subscriber];
}
}
// File: openzeppelin-solidity/contracts/AddressUtils.sol
/**
* Utility library of inline functions on addresses
*/
library AddressUtils {
/**
* Returns whether the target address is a contract
* @dev This function will return false if invoked during the constructor of a contract,
* as the code is not actually created until after the constructor finishes.
* @param addr address to check
* @return whether the target address is a contract
*/
function isContract(address addr) internal view returns (bool) {
uint256 size;
// XXX Currently there is no better way to check if there is a contract in an address
// than to check the size of the code at that address.
// See https://ethereum.stackexchange.com/a/14016/36603
// for more details about how this works.
// TODO Check this again before the Serenity release, because all addresses will be
// contracts then.
// solium-disable-next-line security/no-inline-assembly
assembly { size := extcodesize(addr) }
return size > 0;
}
}
// File: openzeppelin-solidity/contracts/ownership/Ownable.sol
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
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 relinquish control of the contract.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(owner);
owner = address(0);
}
/**
* @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) public onlyOwner {
_transferOwnership(_newOwner);
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
require(_newOwner != address(0));
emit OwnershipTransferred(owner, _newOwner);
owner = _newOwner;
}
}
// File: openzeppelin-solidity/contracts/lifecycle/Pausable.sol
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
paused = true;
emit Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
paused = false;
emit Unpause();
}
}
// File: openzeppelin-solidity/contracts/math/SafeMath.sol
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure 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 a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
// File: openzeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
// File: openzeppelin-solidity/contracts/token/ERC20/BasicToken.sol
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
// File: openzeppelin-solidity/contracts/token/ERC20/ERC20.sol
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender)
public view 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
);
}
// File: openzeppelin-solidity/contracts/token/ERC20/StandardToken.sol
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(
address _owner,
address _spender
)
public
view
returns (uint256)
{
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(
address _spender,
uint _addedValue
)
public
returns (bool)
{
allowed[msg.sender][_spender] = (
allowed[msg.sender][_spender].add(_addedValue));
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(
address _spender,
uint _subtractedValue
)
public
returns (bool)
{
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
// File: openzeppelin-solidity/contracts/token/ERC20/MintableToken.sol
/**
* @title Mintable token
* @dev Simple ERC20 Token example, with mintable token creation
* @dev Issue: * https://github.com/OpenZeppelin/openzeppelin-solidity/issues/120
* Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol
*/
contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
require(!mintingFinished);
_;
}
modifier hasMintPermission() {
require(msg.sender == owner);
_;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(
address _to,
uint256 _amount
)
hasMintPermission
canMint
public
returns (bool)
{
totalSupply_ = totalSupply_.add(_amount);
balances[_to] = balances[_to].add(_amount);
emit Mint(_to, _amount);
emit Transfer(address(0), _to, _amount);
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() onlyOwner canMint public returns (bool) {
mintingFinished = true;
emit MintFinished();
return true;
}
}
// File: contracts/Crowdsale.sol
/**
* @title Crowdsale
* @dev Crowdsale is a base contract for managing a token crowdsale.
* Crowdsales have a start and end block, where investors can make
* token purchases and the crowdsale will assign them tokens based
* on a token per ETH rate. Funds collected are forwarded to a wallet
* as they arrive.
*/
contract Crowdsale is TokenSale, Pausable, Whitelistable {
using AddressUtils for address;
using SafeMath for uint256;
event LogStartBlockChanged(uint256 indexed startBlock);
event LogEndBlockChanged(uint256 indexed endBlock);
event LogMinDepositChanged(uint256 indexed minDeposit);
event LogTokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 indexed amount, uint256 tokenAmount);
// The token being sold
MintableToken public token;
// The start and end block where investments are allowed (both inclusive)
uint256 public startBlock;
uint256 public endBlock;
// How many token units a buyer gets per wei
uint256 public rate;
// Amount of raised money in wei
uint256 public raisedFunds;
// Amount of tokens already sold
uint256 public soldTokens;
// Balances in wei deposited by each subscriber
mapping (address => uint256) public balanceOf;
// The minimum balance for each subscriber in wei
uint256 public minDeposit;
modifier beforeStart() {
require(block.number < startBlock, "already started");
_;
}
modifier beforeEnd() {
require(block.number <= endBlock, "already ended");
_;
}
constructor(
uint256 _startBlock,
uint256 _endBlock,
uint256 _rate,
uint256 _minDeposit,
uint256 maxWhitelistLength,
uint256 whitelistThreshold
)
Whitelistable(maxWhitelistLength, whitelistThreshold) internal
{
require(_startBlock >= block.number, "_startBlock is lower than current block.number");
require(_endBlock >= _startBlock, "_endBlock is lower than _startBlock");
require(_rate > 0, "_rate is zero");
require(_minDeposit > 0, "_minDeposit is zero");
startBlock = _startBlock;
endBlock = _endBlock;
rate = _rate;
minDeposit = _minDeposit;
}
/*
* @return true if crowdsale event has started
*/
function hasStarted() public view returns (bool started) {
return block.number >= startBlock;
}
/*
* @return true if crowdsale event has ended
*/
function hasEnded() public view returns (bool ended) {
return block.number > endBlock;
}
/**
* Change the crowdsale start block number.
* @param _startBlock The new start block
*/
function setStartBlock(uint256 _startBlock) external onlyOwner beforeStart {
require(_startBlock >= block.number, "_startBlock < current block");
require(_startBlock <= endBlock, "_startBlock > endBlock");
require(_startBlock != startBlock, "_startBlock == startBlock");
startBlock = _startBlock;
emit LogStartBlockChanged(_startBlock);
}
/**
* Change the crowdsale end block number.
* @param _endBlock The new end block
*/
function setEndBlock(uint256 _endBlock) external onlyOwner beforeEnd {
require(_endBlock >= block.number, "_endBlock < current block");
require(_endBlock >= startBlock, "_endBlock < startBlock");
require(_endBlock != endBlock, "_endBlock == endBlock");
endBlock = _endBlock;
emit LogEndBlockChanged(_endBlock);
}
/**
* Change the minimum deposit for each subscriber. New value shall be lower than previous.
* @param _minDeposit The minimum deposit for each subscriber, expressed in wei
*/
function setMinDeposit(uint256 _minDeposit) external onlyOwner beforeEnd {
require(0 < _minDeposit && _minDeposit < minDeposit, "_minDeposit is not in [0, minDeposit]");
minDeposit = _minDeposit;
emit LogMinDepositChanged(minDeposit);
}
/**
* Change the maximum whitelist length. New value shall satisfy the #isAllowedWhitelist conditions.
* @param maxWhitelistLength The maximum whitelist length
*/
function setMaxWhitelistLength(uint256 maxWhitelistLength) external onlyOwner beforeEnd {
setMaxWhitelistLengthInternal(maxWhitelistLength);
}
/**
* Change the whitelist threshold balance. New value shall satisfy the #isAllowedWhitelist conditions.
* @param whitelistThreshold The threshold balance (in wei) above which whitelisting is required to invest
*/
function setWhitelistThresholdBalance(uint256 whitelistThreshold) external onlyOwner beforeEnd {
setWhitelistThresholdBalanceInternal(whitelistThreshold);
}
/**
* Add the subscriber to the whitelist.
* @param subscriber The subscriber to add to the whitelist.
*/
function addToWhitelist(address subscriber) external onlyOwner beforeEnd {
addToWhitelistInternal(subscriber);
}
/**
* Removed the subscriber from the whitelist.
* @param subscriber The subscriber to remove from the whitelist.
*/
function removeFromWhitelist(address subscriber) external onlyOwner beforeEnd {
removeFromWhitelistInternal(subscriber, balanceOf[subscriber]);
}
// fallback function can be used to buy tokens
function () external payable whenNotPaused {
buyTokens(msg.sender);
}
// low level token purchase function
function buyTokens(address beneficiary) public payable whenNotPaused {
require(beneficiary != address(0), "beneficiary is zero");
require(isValidPurchase(beneficiary), "invalid purchase by beneficiary");
balanceOf[beneficiary] = balanceOf[beneficiary].add(msg.value);
raisedFunds = raisedFunds.add(msg.value);
uint256 tokenAmount = calculateTokens(msg.value);
soldTokens = soldTokens.add(tokenAmount);
distributeTokens(beneficiary, tokenAmount);
emit LogTokenPurchase(msg.sender, beneficiary, msg.value, tokenAmount);
forwardFunds(msg.value);
}
/**
* @dev Overrides Whitelistable#isAllowedBalance to add minimum deposit logic.
*/
function isAllowedBalance(address beneficiary, uint256 balance) public view returns (bool isReallyAllowed) {
bool hasMinimumBalance = balance >= minDeposit;
return hasMinimumBalance && super.isAllowedBalance(beneficiary, balance);
}
/**
* @dev Determine if the token purchase is valid or not.
* @return true if the transaction can buy tokens
*/
function isValidPurchase(address beneficiary) internal view returns (bool isValid) {
bool withinPeriod = startBlock <= block.number && block.number <= endBlock;
bool nonZeroPurchase = msg.value != 0;
bool isValidBalance = isAllowedBalance(beneficiary, balanceOf[beneficiary].add(msg.value));
return withinPeriod && nonZeroPurchase && isValidBalance;
}
// Calculate the token amount given the invested ether amount.
// Override to create custom fund forwarding mechanisms
function calculateTokens(uint256 amount) internal view returns (uint256 tokenAmount) {
return amount.mul(rate);
}
/**
* @dev Distribute the token amount to the beneficiary.
* @notice Override to create custom distribution mechanisms
*/
function distributeTokens(address beneficiary, uint256 tokenAmount) internal {
token.mint(beneficiary, tokenAmount);
}
// Send ether amount to the fund collection wallet.
// override to create custom fund forwarding mechanisms
function forwardFunds(uint256 amount) internal;
}
// File: contracts/NokuPricingPlan.sol
/**
* @dev The NokuPricingPlan contract defines the responsibilities of a Noku pricing plan.
*/
contract NokuPricingPlan {
/**
* @dev Pay the fee for the service identified by the specified name.
* The fee amount shall already be approved by the client.
* @param serviceName The name of the target service.
* @param multiplier The multiplier of the base service fee to apply.
* @param client The client of the target service.
* @return true if fee has been paid.
*/
function payFee(bytes32 serviceName, uint256 multiplier, address client) public returns(bool paid);
/**
* @dev Get the usage fee for the service identified by the specified name.
* The returned fee amount shall be approved before using #payFee method.
* @param serviceName The name of the target service.
* @param multiplier The multiplier of the base service fee to apply.
* @return The amount to approve before really paying such fee.
*/
function usageFee(bytes32 serviceName, uint256 multiplier) public view returns(uint fee);
}
// File: contracts/NokuCustomToken.sol
contract NokuCustomToken is Ownable {
event LogBurnFinished();
event LogPricingPlanChanged(address indexed caller, address indexed pricingPlan);
// The pricing plan determining the fee to be paid in NOKU tokens by customers for using Noku services
NokuPricingPlan public pricingPlan;
// The entity acting as Custom Token service provider i.e. Noku
address public serviceProvider;
// Flag indicating if Custom Token burning has been permanently finished or not.
bool public burningFinished;
/**
* @dev Modifier to make a function callable only by service provider i.e. Noku.
*/
modifier onlyServiceProvider() {
require(msg.sender == serviceProvider, "caller is not service provider");
_;
}
modifier canBurn() {
require(!burningFinished, "burning finished");
_;
}
constructor(address _pricingPlan, address _serviceProvider) internal {
require(_pricingPlan != 0, "_pricingPlan is zero");
require(_serviceProvider != 0, "_serviceProvider is zero");
pricingPlan = NokuPricingPlan(_pricingPlan);
serviceProvider = _serviceProvider;
}
/**
* @dev Presence of this function indicates the contract is a Custom Token.
*/
function isCustomToken() public pure returns(bool isCustom) {
return true;
}
/**
* @dev Stop burning new tokens.
* @return true if the operation was successful.
*/
function finishBurning() public onlyOwner canBurn returns(bool finished) {
burningFinished = true;
emit LogBurnFinished();
return true;
}
/**
* @dev Change the pricing plan of service fee to be paid in NOKU tokens.
* @param _pricingPlan The pricing plan of NOKU token to be paid, zero means flat subscription.
*/
function setPricingPlan(address _pricingPlan) public onlyServiceProvider {
require(_pricingPlan != 0, "_pricingPlan is 0");
require(_pricingPlan != address(pricingPlan), "_pricingPlan == pricingPlan");
pricingPlan = NokuPricingPlan(_pricingPlan);
emit LogPricingPlanChanged(msg.sender, _pricingPlan);
}
}
// File: contracts/NokuTokenBurner.sol
contract BurnableERC20 is ERC20 {
function burn(uint256 amount) public returns (bool burned);
}
/**
* @dev The NokuTokenBurner contract has the responsibility to burn the configured fraction of received
* ERC20-compliant tokens and distribute the remainder to the configured wallet.
*/
contract NokuTokenBurner is Pausable {
using SafeMath for uint256;
event LogNokuTokenBurnerCreated(address indexed caller, address indexed wallet);
event LogBurningPercentageChanged(address indexed caller, uint256 indexed burningPercentage);
// The wallet receiving the unburnt tokens.
address public wallet;
// The percentage of tokens to burn after being received (range [0, 100])
uint256 public burningPercentage;
// The cumulative amount of burnt tokens.
uint256 public burnedTokens;
// The cumulative amount of tokens transferred back to the wallet.
uint256 public transferredTokens;
/**
* @dev Create a new NokuTokenBurner with predefined burning fraction.
* @param _wallet The wallet receiving the unburnt tokens.
*/
constructor(address _wallet) public {
require(_wallet != address(0), "_wallet is zero");
wallet = _wallet;
burningPercentage = 100;
emit LogNokuTokenBurnerCreated(msg.sender, _wallet);
}
/**
* @dev Change the percentage of tokens to burn after being received.
* @param _burningPercentage The percentage of tokens to be burnt.
*/
function setBurningPercentage(uint256 _burningPercentage) public onlyOwner {
require(0 <= _burningPercentage && _burningPercentage <= 100, "_burningPercentage not in [0, 100]");
require(_burningPercentage != burningPercentage, "_burningPercentage equal to current one");
burningPercentage = _burningPercentage;
emit LogBurningPercentageChanged(msg.sender, _burningPercentage);
}
/**
* @dev Called after burnable tokens has been transferred for burning.
* @param _token THe extended ERC20 interface supported by the sent tokens.
* @param _amount The amount of burnable tokens just arrived ready for burning.
*/
function tokenReceived(address _token, uint256 _amount) public whenNotPaused {
require(_token != address(0), "_token is zero");
require(_amount > 0, "_amount is zero");
uint256 amountToBurn = _amount.mul(burningPercentage).div(100);
if (amountToBurn > 0) {
assert(BurnableERC20(_token).burn(amountToBurn));
burnedTokens = burnedTokens.add(amountToBurn);
}
uint256 amountToTransfer = _amount.sub(amountToBurn);
if (amountToTransfer > 0) {
assert(BurnableERC20(_token).transfer(wallet, amountToTransfer));
transferredTokens = transferredTokens.add(amountToTransfer);
}
}
}
// File: openzeppelin-solidity/contracts/token/ERC20/BurnableToken.sol
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is BasicToken {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public {
_burn(msg.sender, _value);
}
function _burn(address _who, uint256 _value) internal {
require(_value <= balances[_who]);
// no need to require value <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
balances[_who] = balances[_who].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
emit Burn(_who, _value);
emit Transfer(_who, address(0), _value);
}
}
// File: openzeppelin-solidity/contracts/token/ERC20/DetailedERC20.sol
/**
* @title DetailedERC20 token
* @dev The decimals are only for visualization purposes.
* All the operations are done using the smallest and indivisible token unit,
* just as on Ethereum all the operations are done in wei.
*/
contract DetailedERC20 is ERC20 {
string public name;
string public symbol;
uint8 public decimals;
constructor(string _name, string _symbol, uint8 _decimals) public {
name = _name;
symbol = _symbol;
decimals = _decimals;
}
}
// File: openzeppelin-solidity/contracts/token/ERC20/SafeERC20.sol
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure.
* To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
function safeTransfer(ERC20Basic token, address to, uint256 value) internal {
require(token.transfer(to, value));
}
function safeTransferFrom(
ERC20 token,
address from,
address to,
uint256 value
)
internal
{
require(token.transferFrom(from, to, value));
}
function safeApprove(ERC20 token, address spender, uint256 value) internal {
require(token.approve(spender, value));
}
}
// File: openzeppelin-solidity/contracts/token/ERC20/TokenTimelock.sol
/**
* @title TokenTimelock
* @dev TokenTimelock is a token holder contract that will allow a
* beneficiary to extract the tokens after a given release time
*/
contract TokenTimelock {
using SafeERC20 for ERC20Basic;
// ERC20 basic token contract being held
ERC20Basic public token;
// beneficiary of tokens after they are released
address public beneficiary;
// timestamp when token release is enabled
uint256 public releaseTime;
constructor(
ERC20Basic _token,
address _beneficiary,
uint256 _releaseTime
)
public
{
// solium-disable-next-line security/no-block-members
require(_releaseTime > block.timestamp);
token = _token;
beneficiary = _beneficiary;
releaseTime = _releaseTime;
}
/**
* @notice Transfers tokens held by timelock to beneficiary.
*/
function release() public {
// solium-disable-next-line security/no-block-members
require(block.timestamp >= releaseTime);
uint256 amount = token.balanceOf(this);
require(amount > 0);
token.safeTransfer(beneficiary, amount);
}
}
// File: openzeppelin-solidity/contracts/token/ERC20/TokenVesting.sol
/* solium-disable security/no-block-members */
pragma solidity ^0.4.23;
/**
* @title TokenVesting
* @dev A token holder contract that can release its token balance gradually like a
* typical vesting scheme, with a cliff and vesting period. Optionally revocable by the
* owner.
*/
contract TokenVesting is Ownable {
using SafeMath for uint256;
using SafeERC20 for ERC20Basic;
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;
mapping (address => uint256) public released;
mapping (address => bool) public revoked;
/**
* @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 _start the time (as Unix time) at which point vesting starts
* @param _duration duration in seconds of the period in which the tokens will vest
* @param _revocable whether the vesting is revocable or not
*/
constructor(
address _beneficiary,
uint256 _start,
uint256 _cliff,
uint256 _duration,
bool _revocable
)
public
{
require(_beneficiary != address(0));
require(_cliff <= _duration);
beneficiary = _beneficiary;
revocable = _revocable;
duration = _duration;
cliff = _start.add(_cliff);
start = _start;
}
/**
* @notice Transfers vested tokens to beneficiary.
* @param token ERC20 token which is being vested
*/
function release(ERC20Basic token) public {
uint256 unreleased = releasableAmount(token);
require(unreleased > 0);
released[token] = released[token].add(unreleased);
token.safeTransfer(beneficiary, unreleased);
emit Released(unreleased);
}
/**
* @notice Allows the owner to revoke the vesting. Tokens already vested
* remain in the contract, the rest are returned to the owner.
* @param token ERC20 token which is being vested
*/
function revoke(ERC20Basic token) public onlyOwner {
require(revocable);
require(!revoked[token]);
uint256 balance = token.balanceOf(this);
uint256 unreleased = releasableAmount(token);
uint256 refund = balance.sub(unreleased);
revoked[token] = true;
token.safeTransfer(owner, refund);
emit Revoked();
}
/**
* @dev Calculates the amount that has already vested but hasn't been released yet.
* @param token ERC20 token which is being vested
*/
function releasableAmount(ERC20Basic token) public view returns (uint256) {
return vestedAmount(token).sub(released[token]);
}
/**
* @dev Calculates the amount that has already vested.
* @param token ERC20 token which is being vested
*/
function vestedAmount(ERC20Basic token) public view returns (uint256) {
uint256 currentBalance = token.balanceOf(this);
uint256 totalBalance = currentBalance.add(released[token]);
if (block.timestamp < cliff) {
return 0;
} else if (block.timestamp >= start.add(duration) || revoked[token]) {
return totalBalance;
} else {
return totalBalance.mul(block.timestamp.sub(start)).div(duration);
}
}
}
// File: contracts/NokuCustomERC20.sol
/**
* @dev The NokuCustomERC20Token contract is a custom ERC20-compliant token available in the Noku Service Platform (NSP).
* The Noku customer is able to choose the token name, symbol, decimals, initial supply and to administer its lifecycle
* by minting or burning tokens in order to increase or decrease the token supply.
*/
contract NokuCustomERC20 is NokuCustomToken, DetailedERC20, MintableToken, BurnableToken {
using SafeMath for uint256;
event LogNokuCustomERC20Created(
address indexed caller,
string indexed name,
string indexed symbol,
uint8 decimals,
uint256 transferableFromBlock,
uint256 lockEndBlock,
address pricingPlan,
address serviceProvider
);
event LogMintingFeeEnabledChanged(address indexed caller, bool indexed mintingFeeEnabled);
event LogInformationChanged(address indexed caller, string name, string symbol);
event LogTransferFeePaymentFinished(address indexed caller);
event LogTransferFeePercentageChanged(address indexed caller, uint256 indexed transferFeePercentage);
// Flag indicating if minting fees are enabled or disabled
bool public mintingFeeEnabled;
// Block number from which tokens are initially transferable
uint256 public transferableFromBlock;
// Block number from which initial lock ends
uint256 public lockEndBlock;
// The initially locked balances by address
mapping (address => uint256) public initiallyLockedBalanceOf;
// The fee percentage for Custom Token transfer or zero if transfer is free of charge
uint256 public transferFeePercentage;
// Flag indicating if fee payment in Custom Token transfer has been permanently finished or not.
bool public transferFeePaymentFinished;
// Address of optional Timelock smart contract, otherwise 0x0
TokenTimelock public timelock;
// Address of optional Vesting smart contract, otherwise 0x0
TokenVesting public vesting;
bytes32 public constant BURN_SERVICE_NAME = "NokuCustomERC20.burn";
bytes32 public constant MINT_SERVICE_NAME = "NokuCustomERC20.mint";
bytes32 public constant TIMELOCK_SERVICE_NAME = "NokuCustomERC20.timelock";
bytes32 public constant VESTING_SERVICE_NAME = "NokuCustomERC20.vesting";
modifier canTransfer(address _from, uint _value) {
require(block.number >= transferableFromBlock, "token not transferable");
if (block.number < lockEndBlock) {
uint256 locked = lockedBalanceOf(_from);
if (locked > 0) {
uint256 newBalance = balanceOf(_from).sub(_value);
require(newBalance >= locked, "_value exceeds locked amount");
}
}
_;
}
constructor(
string _name,
string _symbol,
uint8 _decimals,
uint256 _transferableFromBlock,
uint256 _lockEndBlock,
address _pricingPlan,
address _serviceProvider
)
NokuCustomToken(_pricingPlan, _serviceProvider)
DetailedERC20(_name, _symbol, _decimals) public
{
require(bytes(_name).length > 0, "_name is empty");
require(bytes(_symbol).length > 0, "_symbol is empty");
require(_lockEndBlock >= _transferableFromBlock, "_lockEndBlock lower than _transferableFromBlock");
transferableFromBlock = _transferableFromBlock;
lockEndBlock = _lockEndBlock;
mintingFeeEnabled = true;
emit LogNokuCustomERC20Created(
msg.sender,
_name,
_symbol,
_decimals,
_transferableFromBlock,
_lockEndBlock,
_pricingPlan,
_serviceProvider
);
}
function setMintingFeeEnabled(bool _mintingFeeEnabled) public onlyOwner returns(bool successful) {
require(_mintingFeeEnabled != mintingFeeEnabled, "_mintingFeeEnabled == mintingFeeEnabled");
mintingFeeEnabled = _mintingFeeEnabled;
emit LogMintingFeeEnabledChanged(msg.sender, _mintingFeeEnabled);
return true;
}
/**
* @dev Change the Custom Token detailed information after creation.
* @param _name The name to assign to the Custom Token.
* @param _symbol The symbol to assign to the Custom Token.
*/
function setInformation(string _name, string _symbol) public onlyOwner returns(bool successful) {
require(bytes(_name).length > 0, "_name is empty");
require(bytes(_symbol).length > 0, "_symbol is empty");
name = _name;
symbol = _symbol;
emit LogInformationChanged(msg.sender, _name, _symbol);
return true;
}
/**
* @dev Stop trasfer fee payment for tokens.
* @return true if the operation was successful.
*/
function finishTransferFeePayment() public onlyOwner returns(bool finished) {
require(!transferFeePaymentFinished, "transfer fee finished");
transferFeePaymentFinished = true;
emit LogTransferFeePaymentFinished(msg.sender);
return true;
}
/**
* @dev Change the transfer fee percentage to be paid in Custom tokens.
* @param _transferFeePercentage The fee percentage to be paid for transfer in range [0, 100].
*/
function setTransferFeePercentage(uint256 _transferFeePercentage) public onlyOwner {
require(0 <= _transferFeePercentage && _transferFeePercentage <= 100, "_transferFeePercentage not in [0, 100]");
require(_transferFeePercentage != transferFeePercentage, "_transferFeePercentage equal to current value");
transferFeePercentage = _transferFeePercentage;
emit LogTransferFeePercentageChanged(msg.sender, _transferFeePercentage);
}
function lockedBalanceOf(address _to) public view returns(uint256 locked) {
uint256 initiallyLocked = initiallyLockedBalanceOf[_to];
if (block.number >= lockEndBlock) return 0;
else if (block.number <= transferableFromBlock) return initiallyLocked;
uint256 releaseForBlock = initiallyLocked.div(lockEndBlock.sub(transferableFromBlock));
uint256 released = block.number.sub(transferableFromBlock).mul(releaseForBlock);
return initiallyLocked.sub(released);
}
/**
* @dev Get the fee to be paid for the transfer of NOKU tokens.
* @param _value The amount of NOKU tokens to be transferred.
*/
function transferFee(uint256 _value) public view returns(uint256 usageFee) {
return _value.mul(transferFeePercentage).div(100);
}
/**
* @dev Check if token transfer is free of any charge or not.
* @return true if transfer is free of any charge.
*/
function freeTransfer() public view returns (bool isTransferFree) {
return transferFeePaymentFinished || transferFeePercentage == 0;
}
/**
* @dev Override #transfer for optionally paying fee to Custom token owner.
*/
function transfer(address _to, uint256 _value) canTransfer(msg.sender, _value) public returns(bool transferred) {
if (freeTransfer()) {
return super.transfer(_to, _value);
}
else {
uint256 usageFee = transferFee(_value);
uint256 netValue = _value.sub(usageFee);
bool feeTransferred = super.transfer(owner, usageFee);
bool netValueTransferred = super.transfer(_to, netValue);
return feeTransferred && netValueTransferred;
}
}
/**
* @dev Override #transferFrom for optionally paying fee to Custom token owner.
*/
function transferFrom(address _from, address _to, uint256 _value) canTransfer(_from, _value) public returns(bool transferred) {
if (freeTransfer()) {
return super.transferFrom(_from, _to, _value);
}
else {
uint256 usageFee = transferFee(_value);
uint256 netValue = _value.sub(usageFee);
bool feeTransferred = super.transferFrom(_from, owner, usageFee);
bool netValueTransferred = super.transferFrom(_from, _to, netValue);
return feeTransferred && netValueTransferred;
}
}
/**
* @dev Burn a specific amount of tokens, paying the service fee.
* @param _amount The amount of token to be burned.
*/
function burn(uint256 _amount) public canBurn {
require(_amount > 0, "_amount is zero");
super.burn(_amount);
require(pricingPlan.payFee(BURN_SERVICE_NAME, _amount, msg.sender), "burn fee failed");
}
/**
* @dev Mint a specific amount of tokens, paying the service fee.
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address _to, uint256 _amount) public onlyOwner canMint returns(bool minted) {
require(_to != 0, "_to is zero");
require(_amount > 0, "_amount is zero");
super.mint(_to, _amount);
if (mintingFeeEnabled) {
require(pricingPlan.payFee(MINT_SERVICE_NAME, _amount, msg.sender), "mint fee failed");
}
return true;
}
/**
* @dev Mint new locked tokens, which will unlock progressively.
* @param _to The address that will receieve the minted locked tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mintLocked(address _to, uint256 _amount) public onlyOwner canMint returns(bool minted) {
initiallyLockedBalanceOf[_to] = initiallyLockedBalanceOf[_to].add(_amount);
return mint(_to, _amount);
}
/**
* @dev Mint the specified amount of timelocked tokens.
* @param _to The address that will receieve the minted locked tokens.
* @param _amount The amount of tokens to mint.
* @param _releaseTime The token release time as timestamp from Unix epoch.
* @return A boolean that indicates if the operation was successful.
*/
function mintTimelocked(address _to, uint256 _amount, uint256 _releaseTime) public onlyOwner canMint
returns(bool minted)
{
require(timelock == address(0), "TokenTimelock already activated");
timelock = new TokenTimelock(this, _to, _releaseTime);
minted = mint(timelock, _amount);
require(pricingPlan.payFee(TIMELOCK_SERVICE_NAME, _amount, msg.sender), "timelock fee failed");
}
/**
* @dev Mint the specified amount of vested tokens.
* @param _to The address that will receieve the minted vested tokens.
* @param _amount The amount of tokens to mint.
* @param _startTime When the vesting starts as timestamp in seconds from Unix epoch.
* @param _duration The duration in seconds of the period in which the tokens will vest.
* @return A boolean that indicates if the operation was successful.
*/
function mintVested(address _to, uint256 _amount, uint256 _startTime, uint256 _duration) public onlyOwner canMint
returns(bool minted)
{
require(vesting == address(0), "TokenVesting already activated");
vesting = new TokenVesting(_to, _startTime, 0, _duration, true);
minted = mint(vesting, _amount);
require(pricingPlan.payFee(VESTING_SERVICE_NAME, _amount, msg.sender), "vesting fee failed");
}
/**
* @dev Release vested tokens to the beneficiary. Anyone can release vested tokens.
* @return A boolean that indicates if the operation was successful.
*/
function releaseVested() public returns(bool released) {
require(vesting != address(0), "TokenVesting not activated");
vesting.release(this);
return true;
}
/**
* @dev Revoke vested tokens. Just the token can revoke because it is the vesting owner.
* @return A boolean that indicates if the operation was successful.
*/
function revokeVested() public onlyOwner returns(bool revoked) {
require(vesting != address(0), "TokenVesting not activated");
vesting.revoke(this);
return true;
}
}
// File: contracts/TokenCappedCrowdsale.sol
/**
* @title CappedCrowdsale
* @dev Extension of Crowsdale with a max amount of funds raised
*/
contract TokenCappedCrowdsale is Crowdsale {
using SafeMath for uint256;
// The maximum token cap, should be initialized in derived contract
uint256 public tokenCap;
// Overriding Crowdsale#hasEnded to add tokenCap logic
// @return true if crowdsale event has ended
function hasEnded() public view returns (bool) {
bool capReached = soldTokens >= tokenCap;
return super.hasEnded() || capReached;
}
// Overriding Crowdsale#isValidPurchase to add extra cap logic
// @return true if investors can buy at the moment
function isValidPurchase(address beneficiary) internal view returns (bool isValid) {
uint256 tokenAmount = calculateTokens(msg.value);
bool withinCap = soldTokens.add(tokenAmount) <= tokenCap;
return withinCap && super.isValidPurchase(beneficiary);
}
}
// File: contracts/NokuCustomCrowdsale.sol
/**
* @title NokuCustomCrowdsale
* @dev Extension of TokenCappedCrowdsale using values specific for Noku Custom ICO crowdsale
*/
contract NokuCustomCrowdsale is TokenCappedCrowdsale {
using AddressUtils for address;
using SafeMath for uint256;
event LogNokuCustomCrowdsaleCreated(
address sender,
uint256 indexed startBlock,
uint256 indexed endBlock,
address indexed wallet
);
event LogThreePowerAgesChanged(
address indexed sender,
uint256 indexed platinumAgeEndBlock,
uint256 indexed goldenAgeEndBlock,
uint256 silverAgeEndBlock,
uint256 platinumAgeRate,
uint256 goldenAgeRate,
uint256 silverAgeRate
);
event LogTwoPowerAgesChanged(
address indexed sender,
uint256 indexed platinumAgeEndBlock,
uint256 indexed goldenAgeEndBlock,
uint256 platinumAgeRate,
uint256 goldenAgeRate
);
event LogOnePowerAgeChanged(address indexed sender, uint256 indexed platinumAgeEndBlock, uint256 indexed platinumAgeRate);
// The end block of the 'platinum' age interval
uint256 public platinumAgeEndBlock;
// The end block of the 'golden' age interval
uint256 public goldenAgeEndBlock;
// The end block of the 'silver' age interval
uint256 public silverAgeEndBlock;
// The conversion rate of the 'platinum' age
uint256 public platinumAgeRate;
// The conversion rate of the 'golden' age
uint256 public goldenAgeRate;
// The conversion rate of the 'silver' age
uint256 public silverAgeRate;
// The wallet address or contract
address public wallet;
constructor(
uint256 _startBlock,
uint256 _endBlock,
uint256 _rate,
uint256 _minDeposit,
uint256 _maxWhitelistLength,
uint256 _whitelistThreshold,
address _token,
uint256 _tokenMaximumSupply,
address _wallet
)
Crowdsale(
_startBlock,
_endBlock,
_rate,
_minDeposit,
_maxWhitelistLength,
_whitelistThreshold
)
public {
require(_token.isContract(), "_token is not contract");
require(_tokenMaximumSupply > 0, "_tokenMaximumSupply is zero");
platinumAgeRate = _rate;
goldenAgeRate = _rate;
silverAgeRate = _rate;
token = NokuCustomERC20(_token);
wallet = _wallet;
// Assume predefined token supply has been minted and calculate the maximum number of tokens that can be sold
tokenCap = _tokenMaximumSupply.sub(token.totalSupply());
emit LogNokuCustomCrowdsaleCreated(msg.sender, startBlock, endBlock, _wallet);
}
function setThreePowerAges(
uint256 _platinumAgeEndBlock,
uint256 _goldenAgeEndBlock,
uint256 _silverAgeEndBlock,
uint256 _platinumAgeRate,
uint256 _goldenAgeRate,
uint256 _silverAgeRate
)
external onlyOwner beforeStart
{
require(startBlock < _platinumAgeEndBlock, "_platinumAgeEndBlock not greater than start block");
require(_platinumAgeEndBlock < _goldenAgeEndBlock, "_platinumAgeEndBlock not lower than _goldenAgeEndBlock");
require(_goldenAgeEndBlock < _silverAgeEndBlock, "_silverAgeEndBlock not greater than _goldenAgeEndBlock");
require(_silverAgeEndBlock <= endBlock, "_silverAgeEndBlock greater than end block");
require(_platinumAgeRate > _goldenAgeRate, "_platinumAgeRate not greater than _goldenAgeRate");
require(_goldenAgeRate > _silverAgeRate, "_goldenAgeRate not greater than _silverAgeRate");
require(_silverAgeRate > rate, "_silverAgeRate not greater than nominal rate");
platinumAgeEndBlock = _platinumAgeEndBlock;
goldenAgeEndBlock = _goldenAgeEndBlock;
silverAgeEndBlock = _silverAgeEndBlock;
platinumAgeRate = _platinumAgeRate;
goldenAgeRate = _goldenAgeRate;
silverAgeRate = _silverAgeRate;
emit LogThreePowerAgesChanged(
msg.sender,
_platinumAgeEndBlock,
_goldenAgeEndBlock,
_silverAgeEndBlock,
_platinumAgeRate,
_goldenAgeRate,
_silverAgeRate
);
}
function setTwoPowerAges(
uint256 _platinumAgeEndBlock,
uint256 _goldenAgeEndBlock,
uint256 _platinumAgeRate,
uint256 _goldenAgeRate
)
external onlyOwner beforeStart
{
require(startBlock < _platinumAgeEndBlock, "_platinumAgeEndBlock not greater than start block");
require(_platinumAgeEndBlock < _goldenAgeEndBlock, "_platinumAgeEndBlock not lower than _goldenAgeEndBlock");
require(_goldenAgeEndBlock <= endBlock, "_goldenAgeEndBlock greater than end block");
require(_platinumAgeRate > _goldenAgeRate, "_platinumAgeRate not greater than _goldenAgeRate");
require(_goldenAgeRate > rate, "_goldenAgeRate not greater than nominal rate");
platinumAgeEndBlock = _platinumAgeEndBlock;
goldenAgeEndBlock = _goldenAgeEndBlock;
platinumAgeRate = _platinumAgeRate;
goldenAgeRate = _goldenAgeRate;
silverAgeRate = rate;
emit LogTwoPowerAgesChanged(
msg.sender,
_platinumAgeEndBlock,
_goldenAgeEndBlock,
_platinumAgeRate,
_goldenAgeRate
);
}
function setOnePowerAge(uint256 _platinumAgeEndBlock, uint256 _platinumAgeRate)
external onlyOwner beforeStart
{
require(startBlock < _platinumAgeEndBlock, "_platinumAgeEndBlock not greater than start block");
require(_platinumAgeEndBlock <= endBlock, "_platinumAgeEndBlock greater than end block");
require(_platinumAgeRate > rate, "_platinumAgeRate not greater than nominal rate");
platinumAgeEndBlock = _platinumAgeEndBlock;
platinumAgeRate = _platinumAgeRate;
goldenAgeRate = rate;
silverAgeRate = rate;
emit LogOnePowerAgeChanged(msg.sender, _platinumAgeEndBlock, _platinumAgeRate);
}
function grantTokenOwnership(address _client) external onlyOwner returns(bool granted) {
require(!_client.isContract(), "_client is contract");
require(hasEnded(), "crowdsale not ended yet");
// Transfer NokuCustomERC20 ownership back to the client
token.transferOwnership(_client);
return true;
}
// Overriding Crowdsale#calculateTokens to apply age discounts to token calculus.
function calculateTokens(uint256 amount) internal view returns(uint256 tokenAmount) {
uint256 conversionRate = block.number <= platinumAgeEndBlock ? platinumAgeRate :
block.number <= goldenAgeEndBlock ? goldenAgeRate :
block.number <= silverAgeEndBlock ? silverAgeRate :
rate;
return amount.mul(conversionRate);
}
/**
* @dev Overriding Crowdsale#distributeTokens to apply age rules to token distributions.
*/
function distributeTokens(address beneficiary, uint256 tokenAmount) internal {
if (block.number <= platinumAgeEndBlock) {
NokuCustomERC20(token).mintLocked(beneficiary, tokenAmount);
}
else {
super.distributeTokens(beneficiary, tokenAmount);
}
}
/**
* @dev Overriding Crowdsale#forwardFunds to split net/fee payment.
*/
function forwardFunds(uint256 amount) internal {
wallet.transfer(amount);
}
}
// File: contracts/NokuCustomService.sol
contract NokuCustomService is Pausable {
using AddressUtils for address;
event LogPricingPlanChanged(address indexed caller, address indexed pricingPlan);
// The pricing plan determining the fee to be paid in NOKU tokens by customers
NokuPricingPlan public pricingPlan;
constructor(address _pricingPlan) internal {
require(_pricingPlan.isContract(), "_pricingPlan is not contract");
pricingPlan = NokuPricingPlan(_pricingPlan);
}
function setPricingPlan(address _pricingPlan) public onlyOwner {
require(_pricingPlan.isContract(), "_pricingPlan is not contract");
require(NokuPricingPlan(_pricingPlan) != pricingPlan, "_pricingPlan equal to current");
pricingPlan = NokuPricingPlan(_pricingPlan);
emit LogPricingPlanChanged(msg.sender, _pricingPlan);
}
}
// File: contracts/NokuCustomCrowdsaleService.sol
/**
* @title NokuCustomCrowdsaleService
* @dev Extension of NokuCustomService adding the fee payment in NOKU tokens.
*/
contract NokuCustomCrowdsaleService is NokuCustomService {
event LogNokuCustomCrowdsaleServiceCreated(address indexed caller);
bytes32 public constant SERVICE_NAME = "NokuCustomERC20.crowdsale";
uint256 public constant CREATE_AMOUNT = 1 * 10**18;
constructor(address _pricingPlan) NokuCustomService(_pricingPlan) public {
emit LogNokuCustomCrowdsaleServiceCreated(msg.sender);
}
function createCustomCrowdsale(
uint256 _startBlock,
uint256 _endBlock,
uint256 _rate,
uint256 _minDeposit,
uint256 _maxWhitelistLength,
uint256 _whitelistThreshold,
address _token,
uint256 _tokenMaximumSupply,
address _wallet
)
public returns(NokuCustomCrowdsale customCrowdsale)
{
customCrowdsale = new NokuCustomCrowdsale(
_startBlock,
_endBlock,
_rate,
_minDeposit,
_maxWhitelistLength,
_whitelistThreshold,
_token,
_tokenMaximumSupply,
_wallet
);
// Transfer NokuCustomCrowdsale ownership to the client
customCrowdsale.transferOwnership(msg.sender);
require(pricingPlan.payFee(SERVICE_NAME, CREATE_AMOUNT, msg.sender), "fee payment failed");
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"constant":false,"inputs":[{"name":"_startBlock","type":"uint256"},{"name":"_endBlock","type":"uint256"},{"name":"_rate","type":"uint256"},{"name":"_minDeposit","type":"uint256"},{"name":"_maxWhitelistLength","type":"uint256"},{"name":"_whitelistThreshold","type":"uint256"},{"name":"_token","type":"address"},{"name":"_tokenMaximumSupply","type":"uint256"},{"name":"_wallet","type":"address"}],"name":"createCustomCrowdsale","outputs":[{"name":"customCrowdsale","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"unpause","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_pricingPlan","type":"address"}],"name":"setPricingPlan","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"paused","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"renounceOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"pause","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"pricingPlan","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"SERVICE_NAME","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"CREATE_AMOUNT","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"_pricingPlan","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"caller","type":"address"}],"name":"LogNokuCustomCrowdsaleServiceCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"caller","type":"address"},{"indexed":true,"name":"pricingPlan","type":"address"}],"name":"LogPricingPlanChanged","type":"event"},{"anonymous":false,"inputs":[],"name":"Pause","type":"event"},{"anonymous":false,"inputs":[],"name":"Unpause","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"}],"name":"OwnershipRenounced","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"},{"indexed":true,"name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"}]Contract Creation Code
60806040526000805460a060020a60ff021916905534801561002057600080fd5b506040516020806135cf833981016040525160008054600160a060020a0319163317905580610064600160a060020a03821664010000000061082a61012282021704565b15156100d157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f5f70726963696e67506c616e206973206e6f7420636f6e747261637400000000604482015290519081900360640190fd5b60018054600160a060020a031916600160a060020a039290921691909117905560405133907f47c3c2200784829cbfca55ad95d489bf454dbc205ef240d48e06fa968b1c1fe590600090a25061012a565b6000903b1190565b613496806101396000396000f300608060405260043610620000ba5763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663338ed3268114620000bf5780633f4ba83a146200011c57806345fc916c14620001365780635c975abb146200015a578063715018a614620001865780638456cb59146200019e5780638da5cb5b14620001b6578063d6c12f8814620001ce578063e3f305c514620001e6578063f2fde38b1462000210578063f97944e01462000234575b600080fd5b348015620000cc57600080fd5b506200010060043560243560443560643560843560a435600160a060020a0360c43581169060e4359061010435166200024c565b60408051600160a060020a039092168252519081900360200190f35b3480156200012957600080fd5b50620001346200048f565b005b3480156200014357600080fd5b5062000134600160a060020a036004351662000518565b3480156200016757600080fd5b506200017262000689565b604080519115158252519081900360200190f35b3480156200019357600080fd5b5062000134620006aa565b348015620001ab57600080fd5b506200013462000717565b348015620001c357600080fd5b5062000100620007b6565b348015620001db57600080fd5b5062000100620007c5565b348015620001f357600080fd5b50620001fe620007d4565b60408051918252519081900360200190f35b3480156200021d57600080fd5b5062000134600160a060020a0360043516620007f8565b3480156200024157600080fd5b50620001fe6200081e565b600089898989898989898962000261620008b0565b98895260208901979097526040808901969096526060880194909452608087019290925260a0860152600160a060020a0390811660c086015260e085019190915291909116610100830152519081900361012001906000f080158015620002cc573d6000803e3d6000fd5b50604080517ff2fde38b0000000000000000000000000000000000000000000000000000000081523360048201529051919250600160a060020a0383169163f2fde38b9160248082019260009290919082900301818387803b1580156200033257600080fd5b505af115801562000347573d6000803e3d6000fd5b5050600154604080517fd30b53860000000000000000000000000000000000000000000000000000000081527f4e6f6b75437573746f6d45524332302e63726f776473616c65000000000000006004820152670de0b6b3a764000060248201523360448201529051600160a060020a03909216935063d30b538692506064808201926020929091908290030181600087803b158015620003e657600080fd5b505af1158015620003fb573d6000803e3d6000fd5b505050506040513d60208110156200041257600080fd5b505115156200048257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f666565207061796d656e74206661696c65640000000000000000000000000000604482015290519081900360640190fd5b9998505050505050505050565b600054600160a060020a03163314620004a757600080fd5b60005474010000000000000000000000000000000000000000900460ff161515620004d157600080fd5b6000805474ff0000000000000000000000000000000000000000191681556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b339190a1565b600054600160a060020a031633146200053057600080fd5b6200054481600160a060020a03166200082a565b1515620005b257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f5f70726963696e67506c616e206973206e6f7420636f6e747261637400000000604482015290519081900360640190fd5b600154600160a060020a03828116911614156200063057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f5f70726963696e67506c616e20657175616c20746f2063757272656e74000000604482015290519081900360640190fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03831690811790915560405133907f9c9a71911f32ca6a40ea2146f75e1c43335f2862b3c1c9696d22cd10e86311c290600090a350565b60005474010000000000000000000000000000000000000000900460ff1681565b600054600160a060020a03163314620006c257600080fd5b60008054604051600160a060020a03909116917ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482091a26000805473ffffffffffffffffffffffffffffffffffffffff19169055565b600054600160a060020a031633146200072f57600080fd5b60005474010000000000000000000000000000000000000000900460ff16156200075857600080fd5b6000805474ff00000000000000000000000000000000000000001916740100000000000000000000000000000000000000001781556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff6259190a1565b600054600160a060020a031681565b600154600160a060020a031681565b7f4e6f6b75437573746f6d45524332302e63726f776473616c650000000000000081565b600054600160a060020a031633146200081057600080fd5b6200081b8162000832565b50565b670de0b6b3a764000081565b6000903b1190565b600160a060020a03811615156200084857600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b604051612ba980620008c283390190560060806040526000805460a060020a60ff02191690553480156200002157600080fd5b506040516101208062002ba983398101604090815281516020830151918301516060840151608085015160a086015160c087015160e08801516101009098015160008054600160a060020a0319163317905595979495939492939192909188888888888881816200009c82826401000000006200056a810204565b15156200010a57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f706172616d6574657273206e6f7420616c6c6f77656400000000000000000000604482015290519081900360640190fd5b60039190915560045543861015620001a957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f5f7374617274426c6f636b206973206c6f776572207468616e2063757272656e60448201527f7420626c6f636b2e6e756d626572000000000000000000000000000000000000606482015290519081900360840190fd5b858510156200023f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f5f656e64426c6f636b206973206c6f776572207468616e205f7374617274426c60448201527f6f636b0000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b60008411620002af57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f5f72617465206973207a65726f00000000000000000000000000000000000000604482015290519081900360640190fd5b600083116200031f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f5f6d696e4465706f736974206973207a65726f00000000000000000000000000604482015290519081900360640190fd5b5050600693909355600791909155600855600c5562000355600160a060020a038416640100000000620020e16200058282021704565b1515620003c357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f5f746f6b656e206973206e6f7420636f6e747261637400000000000000000000604482015290519081900360640190fd5b600082116200043357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f5f746f6b656e4d6178696d756d537570706c79206973207a65726f0000000000604482015290519081900360640190fd5b60118790556012879055601387905560058054600160a060020a03808616600160a060020a0319928316179283905560148054858316931692909217909155604080517f18160ddd00000000000000000000000000000000000000000000000000000000815290516200051193909216916318160ddd916004808201926020929091908290030181600087803b158015620004cd57600080fd5b505af1158015620004e2573d6000803e3d6000fd5b505050506040513d6020811015620004f957600080fd5b505183906401000000006200257e6200058a82021704565b600d55600754600654604080513381529051600160a060020a0385169392917fe2a57f4ee03378204243f5decbfead11790dbbfc790e523150a29937e50af9f3919081900360200190a45050505050505050506200059d565b6000808311806200057b5750600082115b9392505050565b6000903b1190565b6000828211156200059757fe5b50900390565b6125fc80620005ad6000396000f3006080604052600436106102195763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630317c06e811461023b578063083c632314610273578063096d3fee1461029a5780630c36c28a146102af578063184d69ab146102c45780632c4e722e146102d95780633af32abf146102ee5780633f4ba83a1461030f57806341b3d1851461032457806344691f7e1461033957806348cd4cb11461034e5780634ba2d5ff14610363578063521eb2731461038a5780635c975abb146103bb5780635ed9ebfc146103d057806360bf3f47146103e557806366e8730f146103fa57806370a082311461040f578063715018a61461043057806378bb5164146104455780637e7375511461045a5780638456cb591461047257806385482f8914610487578063855ce579146104a25780638ab1d681146104c35780638da5cb5b146104e45780638fcc9cfb146104f95780639b19251a14610511578063c713aa9414610532578063c91ab4bd1461054a578063ca5a3b4a1461055f578063d13010741461057a578063d974bbce1461059b578063dd54291b146105b0578063dfb8dca9146105c5578063e43252d7146105da578063e5560a59146105fb578063ec8ac4d814610610578063ecb70fb714610624578063f2fde38b14610639578063f35e4a6e1461065a578063f95e296e14610672578063fc0c546a14610687578063fe164a5b1461069c575b60005460a060020a900460ff161561023057600080fd5b610239336106b4565b005b34801561024757600080fd5b5061025f600160a060020a036004351660243561085f565b604080519115158252519081900360200190f35b34801561027f57600080fd5b50610288610883565b60408051918252519081900360200190f35b3480156102a657600080fd5b50610288610889565b3480156102bb57600080fd5b5061028861088f565b3480156102d057600080fd5b5061025f610895565b3480156102e557600080fd5b5061028861089e565b3480156102fa57600080fd5b5061025f600160a060020a03600435166108a4565b34801561031b57600080fd5b506102396108c2565b34801561033057600080fd5b50610288610938565b34801561034557600080fd5b5061025f61093e565b34801561035a57600080fd5b50610288610947565b34801561036f57600080fd5b5061023960043560243560443560643560843560a43561094d565b34801561039657600080fd5b5061039f610d91565b60408051600160a060020a039092168252519081900360200190f35b3480156103c757600080fd5b5061025f610da0565b3480156103dc57600080fd5b50610288610db0565b3480156103f157600080fd5b50610288610db6565b34801561040657600080fd5b50610288610dbc565b34801561041b57600080fd5b50610288600160a060020a0360043516610dc2565b34801561043c57600080fd5b50610239610dd4565b34801561045157600080fd5b50610288610e40565b34801561046657600080fd5b50610239600435610e46565b34801561047e57600080fd5b50610239610eb1565b34801561049357600080fd5b50610239600435602435610f2c565b3480156104ae57600080fd5b50610239600435602435604435606435611150565b3480156104cf57600080fd5b50610239600160a060020a0360043516611487565b3480156104f057600080fd5b5061039f61150a565b34801561050557600080fd5b50610239600435611519565b34801561051d57600080fd5b5061025f600160a060020a0360043516611638565b34801561053e57600080fd5b5061023960043561164d565b34801561055657600080fd5b506102886117eb565b34801561056b57600080fd5b5061025f6004356024356117f1565b34801561058657600080fd5b5061025f600160a060020a036004351661180a565b3480156105a757600080fd5b5061028861196e565b3480156105bc57600080fd5b50610288611974565b3480156105d157600080fd5b5061028861197a565b3480156105e657600080fd5b50610239600160a060020a0360043516611980565b34801561060757600080fd5b506102886119e8565b610239600160a060020a03600435166106b4565b34801561063057600080fd5b5061025f6119ee565b34801561064557600080fd5b50610239600160a060020a0360043516611a0f565b34801561066657600080fd5b50610239600435611a2f565b34801561067e57600080fd5b50610288611bcc565b34801561069357600080fd5b5061039f611bd2565b3480156106a857600080fd5b50610239600435611be1565b6000805460a060020a900460ff16156106cc57600080fd5b600160a060020a038216151561072c576040805160e560020a62461bcd02815260206004820152601360248201527f62656e6566696369617279206973207a65726f00000000000000000000000000604482015290519081900360640190fd5b61073582611c49565b151561078b576040805160e560020a62461bcd02815260206004820152601f60248201527f696e76616c69642070757263686173652062792062656e656669636961727900604482015290519081900360640190fd5b600160a060020a0382166000908152600b60205260409020546107b4903463ffffffff611c8616565b600160a060020a0383166000908152600b60205260409020556009546107e0903463ffffffff611c8616565b6009556107ec34611c93565b600a54909150610802908263ffffffff611c8616565b600a5561080f8282611ceb565b6040805182815290513491600160a060020a0385169133917ff370ff51765588b4b12b4ccf319b865dd3499a57df818acfe82c2740e41c878d919081900360200190a461085b34611d9f565b5050565b600c546000908210801590819061087b575061087b8484611dd9565b949350505050565b60075481565b60115481565b600e5481565b60035460001090565b60085481565b600160a060020a031660009081526001602052604090205460ff1690565b600054600160a060020a031633146108d957600080fd5b60005460a060020a900460ff1615156108f157600080fd5b6000805474ff0000000000000000000000000000000000000000191681556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b339190a1565b600c5481565b60065443101590565b60065481565b600054600160a060020a0316331461096457600080fd5b60065443106109ab576040805160e560020a62461bcd02815260206004820152600f60248201526000805160206125b1833981519152604482015290519081900360640190fd5b6006548611610a2a576040805160e560020a62461bcd02815260206004820152603160248201527f5f706c6174696e756d416765456e64426c6f636b206e6f74206772656174657260448201527f207468616e20737461727420626c6f636b000000000000000000000000000000606482015290519081900360840190fd5b848610610aa7576040805160e560020a62461bcd02815260206004820152603660248201527f5f706c6174696e756d416765456e64426c6f636b206e6f74206c6f776572207460448201527f68616e205f676f6c64656e416765456e64426c6f636b00000000000000000000606482015290519081900360840190fd5b838510610b24576040805160e560020a62461bcd02815260206004820152603660248201527f5f73696c766572416765456e64426c6f636b206e6f742067726561746572207460448201527f68616e205f676f6c64656e416765456e64426c6f636b00000000000000000000606482015290519081900360840190fd5b600754841115610ba4576040805160e560020a62461bcd02815260206004820152602960248201527f5f73696c766572416765456e64426c6f636b2067726561746572207468616e2060448201527f656e6420626c6f636b0000000000000000000000000000000000000000000000606482015290519081900360840190fd5b818311610c21576040805160e560020a62461bcd02815260206004820152603060248201527f5f706c6174696e756d41676552617465206e6f7420677265617465722074686160448201527f6e205f676f6c64656e4167655261746500000000000000000000000000000000606482015290519081900360840190fd5b808211610c9e576040805160e560020a62461bcd02815260206004820152602e60248201527f5f676f6c64656e41676552617465206e6f742067726561746572207468616e2060448201527f5f73696c76657241676552617465000000000000000000000000000000000000606482015290519081900360840190fd5b6008548111610d1d576040805160e560020a62461bcd02815260206004820152602c60248201527f5f73696c76657241676552617465206e6f742067726561746572207468616e2060448201527f6e6f6d696e616c20726174650000000000000000000000000000000000000000606482015290519081900360840190fd5b600e869055600f859055601084905560118390556012829055601381905560408051858152602081018590528082018490526060810183905290518691889133917f4f11edaac1b5c6bf8b84063837ffddb237302f46186c872192afdaa860de8f07919081900360800190a4505050505050565b601454600160a060020a031681565b60005460a060020a900460ff1681565b600a5481565b60135481565b60045481565b600b6020526000908152604090205481565b600054600160a060020a03163314610deb57600080fd5b60008054604051600160a060020a03909116917ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482091a26000805473ffffffffffffffffffffffffffffffffffffffff19169055565b60025481565b600054600160a060020a03163314610e5d57600080fd5b600754431115610ea5576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020612591833981519152604482015290519081900360640190fd5b610eae81611e17565b50565b600054600160a060020a03163314610ec857600080fd5b60005460a060020a900460ff1615610edf57600080fd5b6000805474ff0000000000000000000000000000000000000000191660a060020a1781556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff6259190a1565b600054600160a060020a03163314610f4357600080fd5b6006544310610f8a576040805160e560020a62461bcd02815260206004820152600f60248201526000805160206125b1833981519152604482015290519081900360640190fd5b6006548211611009576040805160e560020a62461bcd02815260206004820152603160248201527f5f706c6174696e756d416765456e64426c6f636b206e6f74206772656174657260448201527f207468616e20737461727420626c6f636b000000000000000000000000000000606482015290519081900360840190fd5b600754821115611089576040805160e560020a62461bcd02815260206004820152602b60248201527f5f706c6174696e756d416765456e64426c6f636b20677265617465722074686160448201527f6e20656e6420626c6f636b000000000000000000000000000000000000000000606482015290519081900360840190fd5b6008548111611108576040805160e560020a62461bcd02815260206004820152602e60248201527f5f706c6174696e756d41676552617465206e6f7420677265617465722074686160448201527f6e206e6f6d696e616c2072617465000000000000000000000000000000000000606482015290519081900360840190fd5b600e829055601181905560085460128190556013556040518190839033907fb82b0316b57d808961ac6b7bfbf5e8f97217f80492c61915f175d040794a82c490600090a45050565b600054600160a060020a0316331461116757600080fd5b60065443106111ae576040805160e560020a62461bcd02815260206004820152600f60248201526000805160206125b1833981519152604482015290519081900360640190fd5b600654841161122d576040805160e560020a62461bcd02815260206004820152603160248201527f5f706c6174696e756d416765456e64426c6f636b206e6f74206772656174657260448201527f207468616e20737461727420626c6f636b000000000000000000000000000000606482015290519081900360840190fd5b8284106112aa576040805160e560020a62461bcd02815260206004820152603660248201527f5f706c6174696e756d416765456e64426c6f636b206e6f74206c6f776572207460448201527f68616e205f676f6c64656e416765456e64426c6f636b00000000000000000000606482015290519081900360840190fd5b60075483111561132a576040805160e560020a62461bcd02815260206004820152602960248201527f5f676f6c64656e416765456e64426c6f636b2067726561746572207468616e2060448201527f656e6420626c6f636b0000000000000000000000000000000000000000000000606482015290519081900360840190fd5b8082116113a7576040805160e560020a62461bcd02815260206004820152603060248201527f5f706c6174696e756d41676552617465206e6f7420677265617465722074686160448201527f6e205f676f6c64656e4167655261746500000000000000000000000000000000606482015290519081900360840190fd5b6008548111611426576040805160e560020a62461bcd02815260206004820152602c60248201527f5f676f6c64656e41676552617465206e6f742067726561746572207468616e2060448201527f6e6f6d696e616c20726174650000000000000000000000000000000000000000606482015290519081900360840190fd5b600e849055600f83905560118290556012819055600854601355604080518381526020810183905281518592879233927f90e7a99041d8bb6621f751afbd462b6d878a8f092dd302707e8772dbbcaf237e929181900390910190a450505050565b600054600160a060020a0316331461149e57600080fd5b6007544311156114e6576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020612591833981519152604482015290519081900360640190fd5b600160a060020a0381166000908152600b6020526040902054610eae908290611f2e565b600054600160a060020a031681565b600054600160a060020a0316331461153057600080fd5b600754431115611578576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020612591833981519152604482015290519081900360640190fd5b8060001080156115895750600c5481105b1515611605576040805160e560020a62461bcd02815260206004820152602560248201527f5f6d696e4465706f736974206973206e6f7420696e205b302c206d696e44657060448201527f6f7369745d000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600c81905560405181907f8dfd94aabfe41493b190227cb7ad7f4bb5d3195b4a8ebd1aa4c9071d7e1da52090600090a250565b60016020526000908152604090205460ff1681565b600054600160a060020a0316331461166457600080fd5b6007544311156116ac576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020612591833981519152604482015290519081900360640190fd5b43811015611704576040805160e560020a62461bcd02815260206004820152601960248201527f5f656e64426c6f636b203c2063757272656e7420626c6f636b00000000000000604482015290519081900360640190fd5b60065481101561175e576040805160e560020a62461bcd02815260206004820152601660248201527f5f656e64426c6f636b203c207374617274426c6f636b00000000000000000000604482015290519081900360640190fd5b6007548114156117b8576040805160e560020a62461bcd02815260206004820152601560248201527f5f656e64426c6f636b203d3d20656e64426c6f636b0000000000000000000000604482015290519081900360640190fd5b600781905560405181907fe6ffc56a5fcf08fb9f4ba47da94e3227eb1b200b2fb96f98566cdb821d8054cd90600090a250565b600f5481565b6000808311806118015750600082115b90505b92915050565b60008054600160a060020a0316331461182257600080fd5b61183482600160a060020a03166120e1565b15611889576040805160e560020a62461bcd02815260206004820152601360248201527f5f636c69656e7420697320636f6e747261637400000000000000000000000000604482015290519081900360640190fd5b6118916119ee565b15156118e7576040805160e560020a62461bcd02815260206004820152601760248201527f63726f776473616c65206e6f7420656e64656420796574000000000000000000604482015290519081900360640190fd5b600554604080517ff2fde38b000000000000000000000000000000000000000000000000000000008152600160a060020a0385811660048301529151919092169163f2fde38b91602480830192600092919082900301818387803b15801561194e57600080fd5b505af1158015611962573d6000803e3d6000fd5b50600195945050505050565b60105481565b600d5481565b60095481565b600054600160a060020a0316331461199757600080fd5b6007544311156119df576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020612591833981519152604482015290519081900360640190fd5b610eae816120e9565b60035481565b600d54600a546000911115611a01612273565b80611a095750805b91505090565b600054600160a060020a03163314611a2657600080fd5b610eae8161227b565b600054600160a060020a03163314611a4657600080fd5b6006544310611a8d576040805160e560020a62461bcd02815260206004820152600f60248201526000805160206125b1833981519152604482015290519081900360640190fd5b43811015611ae5576040805160e560020a62461bcd02815260206004820152601b60248201527f5f7374617274426c6f636b203c2063757272656e7420626c6f636b0000000000604482015290519081900360640190fd5b600754811115611b3f576040805160e560020a62461bcd02815260206004820152601660248201527f5f7374617274426c6f636b203e20656e64426c6f636b00000000000000000000604482015290519081900360640190fd5b600654811415611b99576040805160e560020a62461bcd02815260206004820152601960248201527f5f7374617274426c6f636b203d3d207374617274426c6f636b00000000000000604482015290519081900360640190fd5b600681905560405181907f66d92a6c659b7b4cfd2921195dcee1473e8641f17990b926b1ed0687562f787790600090a250565b60125481565b600554600160a060020a031681565b600054600160a060020a03163314611bf857600080fd5b600754431115611c40576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020612591833981519152604482015290519081900360640190fd5b610eae816122f8565b6000806000611c5734611c93565b9150600d54611c7183600a54611c8690919063ffffffff16565b1115905080801561087b575061087b84612441565b8181018281101561180457fe5b600080600e54431115611cce57600f54431115611cc557601054431115611cbc57600854611cc0565b6013545b611cc9565b6012545b611cd2565b6011545b9050611ce4838263ffffffff6124b616565b9392505050565b600e544311611d9557600554604080517f5143e246000000000000000000000000000000000000000000000000000000008152600160a060020a0385811660048301526024820185905291519190921691635143e2469160448083019260209291908290030181600087803b158015611d6357600080fd5b505af1158015611d77573d6000803e3d6000fd5b505050506040513d6020811015611d8d57600080fd5b5061085b9050565b61085b82826124df565b601454604051600160a060020a039091169082156108fc029083906000818181858888f1935050505015801561085b573d6000803e3d6000fd5b6000611de3610895565b1580611df157506004548211155b8061180157505050600160a060020a031660009081526001602052604090205460ff1690565b611e23816004546117f1565b1515611e79576040805160e560020a62461bcd02815260206004820152601f60248201527f5f6d617857686974656c6973744c656e677468206e6f7420616c6c6f77656400604482015290519081900360640190fd5b600354811415611ef9576040805160e560020a62461bcd02815260206004820152602860248201527f5f6d617857686974656c6973744c656e67746820657175616c20746f2063757260448201527f72656e74206f6e65000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b6003819055604051819033907f302325103a9b6166a9c7e9e5a9678fda5b674f8eafd3bef31defd87f1297904990600090a350565b600160a060020a0382161515611f8e576040805160e560020a62461bcd02815260206004820152601360248201527f5f73756273637269626572206973207a65726f00000000000000000000000000604482015290519081900360640190fd5b600160a060020a03821660009081526001602052604090205460ff161515612000576040805160e560020a62461bcd02815260206004820152600f60248201527f6e6f742077686974656c69737465640000000000000000000000000000000000604482015290519081900360640190fd5b600454811115612080576040805160e560020a62461bcd02815260206004820152602960248201527f5f62616c616e63652067726561746572207468616e2077686974656c6973742060448201527f7468726573686f6c640000000000000000000000000000000000000000000000606482015290519081900360840190fd5b60025460001061208c57fe5b60028054600019019055600160a060020a038216600081815260016020526040808220805460ff191690555133917f47661714b17c6a031ca58137c30f0488e4c3f807339a60d1f291285a94e20a7991a35050565b6000903b1190565b600160a060020a0381161515612149576040805160e560020a62461bcd02815260206004820152601360248201527f5f73756273637269626572206973207a65726f00000000000000000000000000604482015290519081900360640190fd5b600160a060020a03811660009081526001602052604090205460ff16156121ba576040805160e560020a62461bcd02815260206004820152601360248201527f616c72656164792077686974656c697374656400000000000000000000000000604482015290519081900360640190fd5b60035460025410612215576040805160e560020a62461bcd02815260206004820152601c60248201527f6d61782077686974656c697374206c656e677468207265616368656400000000604482015290519081900360640190fd5b600280546001908101909155600160a060020a038216600081815260208390526040808220805460ff19169094179093559151909133917fdb06c9d55aafafeffbeaf4857d757a34fbfa810b67516a13e8fd264a058d0fc69190a350565b600754431190565b600160a060020a038116151561229057600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b612304600354826117f1565b1515612380576040805160e560020a62461bcd02815260206004820152602660248201527f5f77686974656c6973745468726573686f6c6442616c616e6365206e6f74206160448201527f6c6c6f7765640000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b6002541580612390575060045481115b151561240c576040805160e560020a62461bcd02815260206004820152603760248201527f5f77686974656c6973745468726573686f6c6442616c616e6365206e6f74206760448201527f726561746572207468616e2063757272656e74206f6e65000000000000000000606482015290519081900360840190fd5b6004819055604051819033907fb5ed79d5f982fdccbd0eeefa0720eb98036492bcc58b4612852b610bc418219c90600090a350565b600080600080436006541115801561245b57506007544311155b600160a060020a0386166000908152600b6020526040902054909350348015159350612498918791612493919063ffffffff611c8616565b61085f565b90508280156124a45750815b80156124ad5750805b95945050505050565b60008215156124c757506000611804565b508181028183828115156124d757fe5b041461180457fe5b600554604080517f40c10f19000000000000000000000000000000000000000000000000000000008152600160a060020a03858116600483015260248201859052915191909216916340c10f199160448083019260209291908290030181600087803b15801561254e57600080fd5b505af1158015612562573d6000803e3d6000fd5b505050506040513d602081101561257857600080fd5b50505050565b60008282111561258a57fe5b509003905600616c726561647920656e64656400000000000000000000000000000000000000616c726561647920737461727465640000000000000000000000000000000000a165627a7a723058208a07cbe2aee6a9ba9c16025c7029011cdb2b18e06cd0c76bf69ca1c8bdee74920029a165627a7a72305820dc35909f3dc27f3516177ab17499778b4de2e9f57a86a28e239bd1ca240bae890029000000000000000000000000749aba9e082ccb185d1ef88fa514339e3c3368d3
Deployed Bytecode
0x608060405260043610620000ba5763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663338ed3268114620000bf5780633f4ba83a146200011c57806345fc916c14620001365780635c975abb146200015a578063715018a614620001865780638456cb59146200019e5780638da5cb5b14620001b6578063d6c12f8814620001ce578063e3f305c514620001e6578063f2fde38b1462000210578063f97944e01462000234575b600080fd5b348015620000cc57600080fd5b506200010060043560243560443560643560843560a435600160a060020a0360c43581169060e4359061010435166200024c565b60408051600160a060020a039092168252519081900360200190f35b3480156200012957600080fd5b50620001346200048f565b005b3480156200014357600080fd5b5062000134600160a060020a036004351662000518565b3480156200016757600080fd5b506200017262000689565b604080519115158252519081900360200190f35b3480156200019357600080fd5b5062000134620006aa565b348015620001ab57600080fd5b506200013462000717565b348015620001c357600080fd5b5062000100620007b6565b348015620001db57600080fd5b5062000100620007c5565b348015620001f357600080fd5b50620001fe620007d4565b60408051918252519081900360200190f35b3480156200021d57600080fd5b5062000134600160a060020a0360043516620007f8565b3480156200024157600080fd5b50620001fe6200081e565b600089898989898989898962000261620008b0565b98895260208901979097526040808901969096526060880194909452608087019290925260a0860152600160a060020a0390811660c086015260e085019190915291909116610100830152519081900361012001906000f080158015620002cc573d6000803e3d6000fd5b50604080517ff2fde38b0000000000000000000000000000000000000000000000000000000081523360048201529051919250600160a060020a0383169163f2fde38b9160248082019260009290919082900301818387803b1580156200033257600080fd5b505af115801562000347573d6000803e3d6000fd5b5050600154604080517fd30b53860000000000000000000000000000000000000000000000000000000081527f4e6f6b75437573746f6d45524332302e63726f776473616c65000000000000006004820152670de0b6b3a764000060248201523360448201529051600160a060020a03909216935063d30b538692506064808201926020929091908290030181600087803b158015620003e657600080fd5b505af1158015620003fb573d6000803e3d6000fd5b505050506040513d60208110156200041257600080fd5b505115156200048257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f666565207061796d656e74206661696c65640000000000000000000000000000604482015290519081900360640190fd5b9998505050505050505050565b600054600160a060020a03163314620004a757600080fd5b60005474010000000000000000000000000000000000000000900460ff161515620004d157600080fd5b6000805474ff0000000000000000000000000000000000000000191681556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b339190a1565b600054600160a060020a031633146200053057600080fd5b6200054481600160a060020a03166200082a565b1515620005b257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f5f70726963696e67506c616e206973206e6f7420636f6e747261637400000000604482015290519081900360640190fd5b600154600160a060020a03828116911614156200063057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f5f70726963696e67506c616e20657175616c20746f2063757272656e74000000604482015290519081900360640190fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03831690811790915560405133907f9c9a71911f32ca6a40ea2146f75e1c43335f2862b3c1c9696d22cd10e86311c290600090a350565b60005474010000000000000000000000000000000000000000900460ff1681565b600054600160a060020a03163314620006c257600080fd5b60008054604051600160a060020a03909116917ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482091a26000805473ffffffffffffffffffffffffffffffffffffffff19169055565b600054600160a060020a031633146200072f57600080fd5b60005474010000000000000000000000000000000000000000900460ff16156200075857600080fd5b6000805474ff00000000000000000000000000000000000000001916740100000000000000000000000000000000000000001781556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff6259190a1565b600054600160a060020a031681565b600154600160a060020a031681565b7f4e6f6b75437573746f6d45524332302e63726f776473616c650000000000000081565b600054600160a060020a031633146200081057600080fd5b6200081b8162000832565b50565b670de0b6b3a764000081565b6000903b1190565b600160a060020a03811615156200084857600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b604051612ba980620008c283390190560060806040526000805460a060020a60ff02191690553480156200002157600080fd5b506040516101208062002ba983398101604090815281516020830151918301516060840151608085015160a086015160c087015160e08801516101009098015160008054600160a060020a0319163317905595979495939492939192909188888888888881816200009c82826401000000006200056a810204565b15156200010a57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f706172616d6574657273206e6f7420616c6c6f77656400000000000000000000604482015290519081900360640190fd5b60039190915560045543861015620001a957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f5f7374617274426c6f636b206973206c6f776572207468616e2063757272656e60448201527f7420626c6f636b2e6e756d626572000000000000000000000000000000000000606482015290519081900360840190fd5b858510156200023f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f5f656e64426c6f636b206973206c6f776572207468616e205f7374617274426c60448201527f6f636b0000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b60008411620002af57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f5f72617465206973207a65726f00000000000000000000000000000000000000604482015290519081900360640190fd5b600083116200031f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f5f6d696e4465706f736974206973207a65726f00000000000000000000000000604482015290519081900360640190fd5b5050600693909355600791909155600855600c5562000355600160a060020a038416640100000000620020e16200058282021704565b1515620003c357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f5f746f6b656e206973206e6f7420636f6e747261637400000000000000000000604482015290519081900360640190fd5b600082116200043357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f5f746f6b656e4d6178696d756d537570706c79206973207a65726f0000000000604482015290519081900360640190fd5b60118790556012879055601387905560058054600160a060020a03808616600160a060020a0319928316179283905560148054858316931692909217909155604080517f18160ddd00000000000000000000000000000000000000000000000000000000815290516200051193909216916318160ddd916004808201926020929091908290030181600087803b158015620004cd57600080fd5b505af1158015620004e2573d6000803e3d6000fd5b505050506040513d6020811015620004f957600080fd5b505183906401000000006200257e6200058a82021704565b600d55600754600654604080513381529051600160a060020a0385169392917fe2a57f4ee03378204243f5decbfead11790dbbfc790e523150a29937e50af9f3919081900360200190a45050505050505050506200059d565b6000808311806200057b5750600082115b9392505050565b6000903b1190565b6000828211156200059757fe5b50900390565b6125fc80620005ad6000396000f3006080604052600436106102195763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630317c06e811461023b578063083c632314610273578063096d3fee1461029a5780630c36c28a146102af578063184d69ab146102c45780632c4e722e146102d95780633af32abf146102ee5780633f4ba83a1461030f57806341b3d1851461032457806344691f7e1461033957806348cd4cb11461034e5780634ba2d5ff14610363578063521eb2731461038a5780635c975abb146103bb5780635ed9ebfc146103d057806360bf3f47146103e557806366e8730f146103fa57806370a082311461040f578063715018a61461043057806378bb5164146104455780637e7375511461045a5780638456cb591461047257806385482f8914610487578063855ce579146104a25780638ab1d681146104c35780638da5cb5b146104e45780638fcc9cfb146104f95780639b19251a14610511578063c713aa9414610532578063c91ab4bd1461054a578063ca5a3b4a1461055f578063d13010741461057a578063d974bbce1461059b578063dd54291b146105b0578063dfb8dca9146105c5578063e43252d7146105da578063e5560a59146105fb578063ec8ac4d814610610578063ecb70fb714610624578063f2fde38b14610639578063f35e4a6e1461065a578063f95e296e14610672578063fc0c546a14610687578063fe164a5b1461069c575b60005460a060020a900460ff161561023057600080fd5b610239336106b4565b005b34801561024757600080fd5b5061025f600160a060020a036004351660243561085f565b604080519115158252519081900360200190f35b34801561027f57600080fd5b50610288610883565b60408051918252519081900360200190f35b3480156102a657600080fd5b50610288610889565b3480156102bb57600080fd5b5061028861088f565b3480156102d057600080fd5b5061025f610895565b3480156102e557600080fd5b5061028861089e565b3480156102fa57600080fd5b5061025f600160a060020a03600435166108a4565b34801561031b57600080fd5b506102396108c2565b34801561033057600080fd5b50610288610938565b34801561034557600080fd5b5061025f61093e565b34801561035a57600080fd5b50610288610947565b34801561036f57600080fd5b5061023960043560243560443560643560843560a43561094d565b34801561039657600080fd5b5061039f610d91565b60408051600160a060020a039092168252519081900360200190f35b3480156103c757600080fd5b5061025f610da0565b3480156103dc57600080fd5b50610288610db0565b3480156103f157600080fd5b50610288610db6565b34801561040657600080fd5b50610288610dbc565b34801561041b57600080fd5b50610288600160a060020a0360043516610dc2565b34801561043c57600080fd5b50610239610dd4565b34801561045157600080fd5b50610288610e40565b34801561046657600080fd5b50610239600435610e46565b34801561047e57600080fd5b50610239610eb1565b34801561049357600080fd5b50610239600435602435610f2c565b3480156104ae57600080fd5b50610239600435602435604435606435611150565b3480156104cf57600080fd5b50610239600160a060020a0360043516611487565b3480156104f057600080fd5b5061039f61150a565b34801561050557600080fd5b50610239600435611519565b34801561051d57600080fd5b5061025f600160a060020a0360043516611638565b34801561053e57600080fd5b5061023960043561164d565b34801561055657600080fd5b506102886117eb565b34801561056b57600080fd5b5061025f6004356024356117f1565b34801561058657600080fd5b5061025f600160a060020a036004351661180a565b3480156105a757600080fd5b5061028861196e565b3480156105bc57600080fd5b50610288611974565b3480156105d157600080fd5b5061028861197a565b3480156105e657600080fd5b50610239600160a060020a0360043516611980565b34801561060757600080fd5b506102886119e8565b610239600160a060020a03600435166106b4565b34801561063057600080fd5b5061025f6119ee565b34801561064557600080fd5b50610239600160a060020a0360043516611a0f565b34801561066657600080fd5b50610239600435611a2f565b34801561067e57600080fd5b50610288611bcc565b34801561069357600080fd5b5061039f611bd2565b3480156106a857600080fd5b50610239600435611be1565b6000805460a060020a900460ff16156106cc57600080fd5b600160a060020a038216151561072c576040805160e560020a62461bcd02815260206004820152601360248201527f62656e6566696369617279206973207a65726f00000000000000000000000000604482015290519081900360640190fd5b61073582611c49565b151561078b576040805160e560020a62461bcd02815260206004820152601f60248201527f696e76616c69642070757263686173652062792062656e656669636961727900604482015290519081900360640190fd5b600160a060020a0382166000908152600b60205260409020546107b4903463ffffffff611c8616565b600160a060020a0383166000908152600b60205260409020556009546107e0903463ffffffff611c8616565b6009556107ec34611c93565b600a54909150610802908263ffffffff611c8616565b600a5561080f8282611ceb565b6040805182815290513491600160a060020a0385169133917ff370ff51765588b4b12b4ccf319b865dd3499a57df818acfe82c2740e41c878d919081900360200190a461085b34611d9f565b5050565b600c546000908210801590819061087b575061087b8484611dd9565b949350505050565b60075481565b60115481565b600e5481565b60035460001090565b60085481565b600160a060020a031660009081526001602052604090205460ff1690565b600054600160a060020a031633146108d957600080fd5b60005460a060020a900460ff1615156108f157600080fd5b6000805474ff0000000000000000000000000000000000000000191681556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b339190a1565b600c5481565b60065443101590565b60065481565b600054600160a060020a0316331461096457600080fd5b60065443106109ab576040805160e560020a62461bcd02815260206004820152600f60248201526000805160206125b1833981519152604482015290519081900360640190fd5b6006548611610a2a576040805160e560020a62461bcd02815260206004820152603160248201527f5f706c6174696e756d416765456e64426c6f636b206e6f74206772656174657260448201527f207468616e20737461727420626c6f636b000000000000000000000000000000606482015290519081900360840190fd5b848610610aa7576040805160e560020a62461bcd02815260206004820152603660248201527f5f706c6174696e756d416765456e64426c6f636b206e6f74206c6f776572207460448201527f68616e205f676f6c64656e416765456e64426c6f636b00000000000000000000606482015290519081900360840190fd5b838510610b24576040805160e560020a62461bcd02815260206004820152603660248201527f5f73696c766572416765456e64426c6f636b206e6f742067726561746572207460448201527f68616e205f676f6c64656e416765456e64426c6f636b00000000000000000000606482015290519081900360840190fd5b600754841115610ba4576040805160e560020a62461bcd02815260206004820152602960248201527f5f73696c766572416765456e64426c6f636b2067726561746572207468616e2060448201527f656e6420626c6f636b0000000000000000000000000000000000000000000000606482015290519081900360840190fd5b818311610c21576040805160e560020a62461bcd02815260206004820152603060248201527f5f706c6174696e756d41676552617465206e6f7420677265617465722074686160448201527f6e205f676f6c64656e4167655261746500000000000000000000000000000000606482015290519081900360840190fd5b808211610c9e576040805160e560020a62461bcd02815260206004820152602e60248201527f5f676f6c64656e41676552617465206e6f742067726561746572207468616e2060448201527f5f73696c76657241676552617465000000000000000000000000000000000000606482015290519081900360840190fd5b6008548111610d1d576040805160e560020a62461bcd02815260206004820152602c60248201527f5f73696c76657241676552617465206e6f742067726561746572207468616e2060448201527f6e6f6d696e616c20726174650000000000000000000000000000000000000000606482015290519081900360840190fd5b600e869055600f859055601084905560118390556012829055601381905560408051858152602081018590528082018490526060810183905290518691889133917f4f11edaac1b5c6bf8b84063837ffddb237302f46186c872192afdaa860de8f07919081900360800190a4505050505050565b601454600160a060020a031681565b60005460a060020a900460ff1681565b600a5481565b60135481565b60045481565b600b6020526000908152604090205481565b600054600160a060020a03163314610deb57600080fd5b60008054604051600160a060020a03909116917ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482091a26000805473ffffffffffffffffffffffffffffffffffffffff19169055565b60025481565b600054600160a060020a03163314610e5d57600080fd5b600754431115610ea5576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020612591833981519152604482015290519081900360640190fd5b610eae81611e17565b50565b600054600160a060020a03163314610ec857600080fd5b60005460a060020a900460ff1615610edf57600080fd5b6000805474ff0000000000000000000000000000000000000000191660a060020a1781556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff6259190a1565b600054600160a060020a03163314610f4357600080fd5b6006544310610f8a576040805160e560020a62461bcd02815260206004820152600f60248201526000805160206125b1833981519152604482015290519081900360640190fd5b6006548211611009576040805160e560020a62461bcd02815260206004820152603160248201527f5f706c6174696e756d416765456e64426c6f636b206e6f74206772656174657260448201527f207468616e20737461727420626c6f636b000000000000000000000000000000606482015290519081900360840190fd5b600754821115611089576040805160e560020a62461bcd02815260206004820152602b60248201527f5f706c6174696e756d416765456e64426c6f636b20677265617465722074686160448201527f6e20656e6420626c6f636b000000000000000000000000000000000000000000606482015290519081900360840190fd5b6008548111611108576040805160e560020a62461bcd02815260206004820152602e60248201527f5f706c6174696e756d41676552617465206e6f7420677265617465722074686160448201527f6e206e6f6d696e616c2072617465000000000000000000000000000000000000606482015290519081900360840190fd5b600e829055601181905560085460128190556013556040518190839033907fb82b0316b57d808961ac6b7bfbf5e8f97217f80492c61915f175d040794a82c490600090a45050565b600054600160a060020a0316331461116757600080fd5b60065443106111ae576040805160e560020a62461bcd02815260206004820152600f60248201526000805160206125b1833981519152604482015290519081900360640190fd5b600654841161122d576040805160e560020a62461bcd02815260206004820152603160248201527f5f706c6174696e756d416765456e64426c6f636b206e6f74206772656174657260448201527f207468616e20737461727420626c6f636b000000000000000000000000000000606482015290519081900360840190fd5b8284106112aa576040805160e560020a62461bcd02815260206004820152603660248201527f5f706c6174696e756d416765456e64426c6f636b206e6f74206c6f776572207460448201527f68616e205f676f6c64656e416765456e64426c6f636b00000000000000000000606482015290519081900360840190fd5b60075483111561132a576040805160e560020a62461bcd02815260206004820152602960248201527f5f676f6c64656e416765456e64426c6f636b2067726561746572207468616e2060448201527f656e6420626c6f636b0000000000000000000000000000000000000000000000606482015290519081900360840190fd5b8082116113a7576040805160e560020a62461bcd02815260206004820152603060248201527f5f706c6174696e756d41676552617465206e6f7420677265617465722074686160448201527f6e205f676f6c64656e4167655261746500000000000000000000000000000000606482015290519081900360840190fd5b6008548111611426576040805160e560020a62461bcd02815260206004820152602c60248201527f5f676f6c64656e41676552617465206e6f742067726561746572207468616e2060448201527f6e6f6d696e616c20726174650000000000000000000000000000000000000000606482015290519081900360840190fd5b600e849055600f83905560118290556012819055600854601355604080518381526020810183905281518592879233927f90e7a99041d8bb6621f751afbd462b6d878a8f092dd302707e8772dbbcaf237e929181900390910190a450505050565b600054600160a060020a0316331461149e57600080fd5b6007544311156114e6576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020612591833981519152604482015290519081900360640190fd5b600160a060020a0381166000908152600b6020526040902054610eae908290611f2e565b600054600160a060020a031681565b600054600160a060020a0316331461153057600080fd5b600754431115611578576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020612591833981519152604482015290519081900360640190fd5b8060001080156115895750600c5481105b1515611605576040805160e560020a62461bcd02815260206004820152602560248201527f5f6d696e4465706f736974206973206e6f7420696e205b302c206d696e44657060448201527f6f7369745d000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600c81905560405181907f8dfd94aabfe41493b190227cb7ad7f4bb5d3195b4a8ebd1aa4c9071d7e1da52090600090a250565b60016020526000908152604090205460ff1681565b600054600160a060020a0316331461166457600080fd5b6007544311156116ac576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020612591833981519152604482015290519081900360640190fd5b43811015611704576040805160e560020a62461bcd02815260206004820152601960248201527f5f656e64426c6f636b203c2063757272656e7420626c6f636b00000000000000604482015290519081900360640190fd5b60065481101561175e576040805160e560020a62461bcd02815260206004820152601660248201527f5f656e64426c6f636b203c207374617274426c6f636b00000000000000000000604482015290519081900360640190fd5b6007548114156117b8576040805160e560020a62461bcd02815260206004820152601560248201527f5f656e64426c6f636b203d3d20656e64426c6f636b0000000000000000000000604482015290519081900360640190fd5b600781905560405181907fe6ffc56a5fcf08fb9f4ba47da94e3227eb1b200b2fb96f98566cdb821d8054cd90600090a250565b600f5481565b6000808311806118015750600082115b90505b92915050565b60008054600160a060020a0316331461182257600080fd5b61183482600160a060020a03166120e1565b15611889576040805160e560020a62461bcd02815260206004820152601360248201527f5f636c69656e7420697320636f6e747261637400000000000000000000000000604482015290519081900360640190fd5b6118916119ee565b15156118e7576040805160e560020a62461bcd02815260206004820152601760248201527f63726f776473616c65206e6f7420656e64656420796574000000000000000000604482015290519081900360640190fd5b600554604080517ff2fde38b000000000000000000000000000000000000000000000000000000008152600160a060020a0385811660048301529151919092169163f2fde38b91602480830192600092919082900301818387803b15801561194e57600080fd5b505af1158015611962573d6000803e3d6000fd5b50600195945050505050565b60105481565b600d5481565b60095481565b600054600160a060020a0316331461199757600080fd5b6007544311156119df576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020612591833981519152604482015290519081900360640190fd5b610eae816120e9565b60035481565b600d54600a546000911115611a01612273565b80611a095750805b91505090565b600054600160a060020a03163314611a2657600080fd5b610eae8161227b565b600054600160a060020a03163314611a4657600080fd5b6006544310611a8d576040805160e560020a62461bcd02815260206004820152600f60248201526000805160206125b1833981519152604482015290519081900360640190fd5b43811015611ae5576040805160e560020a62461bcd02815260206004820152601b60248201527f5f7374617274426c6f636b203c2063757272656e7420626c6f636b0000000000604482015290519081900360640190fd5b600754811115611b3f576040805160e560020a62461bcd02815260206004820152601660248201527f5f7374617274426c6f636b203e20656e64426c6f636b00000000000000000000604482015290519081900360640190fd5b600654811415611b99576040805160e560020a62461bcd02815260206004820152601960248201527f5f7374617274426c6f636b203d3d207374617274426c6f636b00000000000000604482015290519081900360640190fd5b600681905560405181907f66d92a6c659b7b4cfd2921195dcee1473e8641f17990b926b1ed0687562f787790600090a250565b60125481565b600554600160a060020a031681565b600054600160a060020a03163314611bf857600080fd5b600754431115611c40576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020612591833981519152604482015290519081900360640190fd5b610eae816122f8565b6000806000611c5734611c93565b9150600d54611c7183600a54611c8690919063ffffffff16565b1115905080801561087b575061087b84612441565b8181018281101561180457fe5b600080600e54431115611cce57600f54431115611cc557601054431115611cbc57600854611cc0565b6013545b611cc9565b6012545b611cd2565b6011545b9050611ce4838263ffffffff6124b616565b9392505050565b600e544311611d9557600554604080517f5143e246000000000000000000000000000000000000000000000000000000008152600160a060020a0385811660048301526024820185905291519190921691635143e2469160448083019260209291908290030181600087803b158015611d6357600080fd5b505af1158015611d77573d6000803e3d6000fd5b505050506040513d6020811015611d8d57600080fd5b5061085b9050565b61085b82826124df565b601454604051600160a060020a039091169082156108fc029083906000818181858888f1935050505015801561085b573d6000803e3d6000fd5b6000611de3610895565b1580611df157506004548211155b8061180157505050600160a060020a031660009081526001602052604090205460ff1690565b611e23816004546117f1565b1515611e79576040805160e560020a62461bcd02815260206004820152601f60248201527f5f6d617857686974656c6973744c656e677468206e6f7420616c6c6f77656400604482015290519081900360640190fd5b600354811415611ef9576040805160e560020a62461bcd02815260206004820152602860248201527f5f6d617857686974656c6973744c656e67746820657175616c20746f2063757260448201527f72656e74206f6e65000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b6003819055604051819033907f302325103a9b6166a9c7e9e5a9678fda5b674f8eafd3bef31defd87f1297904990600090a350565b600160a060020a0382161515611f8e576040805160e560020a62461bcd02815260206004820152601360248201527f5f73756273637269626572206973207a65726f00000000000000000000000000604482015290519081900360640190fd5b600160a060020a03821660009081526001602052604090205460ff161515612000576040805160e560020a62461bcd02815260206004820152600f60248201527f6e6f742077686974656c69737465640000000000000000000000000000000000604482015290519081900360640190fd5b600454811115612080576040805160e560020a62461bcd02815260206004820152602960248201527f5f62616c616e63652067726561746572207468616e2077686974656c6973742060448201527f7468726573686f6c640000000000000000000000000000000000000000000000606482015290519081900360840190fd5b60025460001061208c57fe5b60028054600019019055600160a060020a038216600081815260016020526040808220805460ff191690555133917f47661714b17c6a031ca58137c30f0488e4c3f807339a60d1f291285a94e20a7991a35050565b6000903b1190565b600160a060020a0381161515612149576040805160e560020a62461bcd02815260206004820152601360248201527f5f73756273637269626572206973207a65726f00000000000000000000000000604482015290519081900360640190fd5b600160a060020a03811660009081526001602052604090205460ff16156121ba576040805160e560020a62461bcd02815260206004820152601360248201527f616c72656164792077686974656c697374656400000000000000000000000000604482015290519081900360640190fd5b60035460025410612215576040805160e560020a62461bcd02815260206004820152601c60248201527f6d61782077686974656c697374206c656e677468207265616368656400000000604482015290519081900360640190fd5b600280546001908101909155600160a060020a038216600081815260208390526040808220805460ff19169094179093559151909133917fdb06c9d55aafafeffbeaf4857d757a34fbfa810b67516a13e8fd264a058d0fc69190a350565b600754431190565b600160a060020a038116151561229057600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b612304600354826117f1565b1515612380576040805160e560020a62461bcd02815260206004820152602660248201527f5f77686974656c6973745468726573686f6c6442616c616e6365206e6f74206160448201527f6c6c6f7765640000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b6002541580612390575060045481115b151561240c576040805160e560020a62461bcd02815260206004820152603760248201527f5f77686974656c6973745468726573686f6c6442616c616e6365206e6f74206760448201527f726561746572207468616e2063757272656e74206f6e65000000000000000000606482015290519081900360840190fd5b6004819055604051819033907fb5ed79d5f982fdccbd0eeefa0720eb98036492bcc58b4612852b610bc418219c90600090a350565b600080600080436006541115801561245b57506007544311155b600160a060020a0386166000908152600b6020526040902054909350348015159350612498918791612493919063ffffffff611c8616565b61085f565b90508280156124a45750815b80156124ad5750805b95945050505050565b60008215156124c757506000611804565b508181028183828115156124d757fe5b041461180457fe5b600554604080517f40c10f19000000000000000000000000000000000000000000000000000000008152600160a060020a03858116600483015260248201859052915191909216916340c10f199160448083019260209291908290030181600087803b15801561254e57600080fd5b505af1158015612562573d6000803e3d6000fd5b505050506040513d602081101561257857600080fd5b50505050565b60008282111561258a57fe5b509003905600616c726561647920656e64656400000000000000000000000000000000000000616c726561647920737461727465640000000000000000000000000000000000a165627a7a723058208a07cbe2aee6a9ba9c16025c7029011cdb2b18e06cd0c76bf69ca1c8bdee74920029a165627a7a72305820dc35909f3dc27f3516177ab17499778b4de2e9f57a86a28e239bd1ca240bae890029
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000749aba9e082ccb185d1ef88fa514339e3c3368d3
-----Decoded View---------------
Arg [0] : _pricingPlan (address): 0x749aBA9E082ccb185D1EF88Fa514339e3c3368D3
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000749aba9e082ccb185d1ef88fa514339e3c3368d3
Swarm Source
bzzr://dc35909f3dc27f3516177ab17499778b4de2e9f57a86a28e239bd1ca240bae89
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 33 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.