Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0x05646585...73e760746 The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
DxGenAuction4Rep
Compiler Version
v0.5.4+commit.9549d8ff
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity)
/**
*Submitted for verification at Etherscan.io on 2019-04-11
*/
// File: openzeppelin-solidity/contracts/math/SafeMath.sol
pragma solidity ^0.5.0;
/**
* @title SafeMath
* @dev Unsigned math operations with safety checks that revert on error
*/
library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring '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;
}
uint256 c = a * b;
require(c / a == b);
return c;
}
/**
* @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a);
uint256 c = a - b;
return c;
}
/**
* @dev Adds two unsigned integers, reverts on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a);
return c;
}
/**
* @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0);
return a % b;
}
}
// File: openzeppelin-solidity/contracts/ownership/Ownable.sol
pragma solidity ^0.5.0;
/**
* @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 private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor () internal {
_owner = msg.sender;
emit OwnershipTransferred(address(0), _owner);
}
/**
* @return the address of the owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(isOwner());
_;
}
/**
* @return true if `msg.sender` is the owner of the contract.
*/
function isOwner() public view returns (bool) {
return msg.sender == _owner;
}
/**
* @dev Allows the current owner to relinquish control of the contract.
* @notice Renouncing to ownership will leave the contract without an owner.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_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: @daostack/infra/contracts/Reputation.sol
pragma solidity ^0.5.4;
/**
* @title Reputation system
* @dev A DAO has Reputation System which allows peers to rate other peers in order to build trust .
* A reputation is use to assign influence measure to a DAO'S peers.
* Reputation is similar to regular tokens but with one crucial difference: It is non-transferable.
* The Reputation contract maintain a map of address to reputation value.
* It provides an onlyOwner functions to mint and burn reputation _to (or _from) a specific address.
*/
contract Reputation is Ownable {
uint8 public decimals = 18; //Number of decimals of the smallest unit
// Event indicating minting of reputation to an address.
event Mint(address indexed _to, uint256 _amount);
// Event indicating burning of reputation for an address.
event Burn(address indexed _from, uint256 _amount);
/// @dev `Checkpoint` is the structure that attaches a block number to a
/// given value, the block number attached is the one that last changed the
/// value
struct Checkpoint {
// `fromBlock` is the block number that the value was generated from
uint128 fromBlock;
// `value` is the amount of reputation at a specific block number
uint128 value;
}
// `balances` is the map that tracks the balance of each address, in this
// contract when the balance changes the block number that the change
// occurred is also included in the map
mapping (address => Checkpoint[]) balances;
// Tracks the history of the `totalSupply` of the reputation
Checkpoint[] totalSupplyHistory;
/// @notice Constructor to create a Reputation
constructor(
) public
{
}
/// @dev This function makes it easy to get the total number of reputation
/// @return The total number of reputation
function totalSupply() public view returns (uint256) {
return totalSupplyAt(block.number);
}
////////////////
// Query balance and totalSupply in History
////////////////
/**
* @dev return the reputation amount of a given owner
* @param _owner an address of the owner which we want to get his reputation
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return balanceOfAt(_owner, block.number);
}
/// @dev Queries the balance of `_owner` at a specific `_blockNumber`
/// @param _owner The address from which the balance will be retrieved
/// @param _blockNumber The block number when the balance is queried
/// @return The balance at `_blockNumber`
function balanceOfAt(address _owner, uint256 _blockNumber)
public view returns (uint256)
{
if ((balances[_owner].length == 0) || (balances[_owner][0].fromBlock > _blockNumber)) {
return 0;
// This will return the expected balance during normal situations
} else {
return getValueAt(balances[_owner], _blockNumber);
}
}
/// @notice Total amount of reputation at a specific `_blockNumber`.
/// @param _blockNumber The block number when the totalSupply is queried
/// @return The total amount of reputation at `_blockNumber`
function totalSupplyAt(uint256 _blockNumber) public view returns(uint256) {
if ((totalSupplyHistory.length == 0) || (totalSupplyHistory[0].fromBlock > _blockNumber)) {
return 0;
// This will return the expected totalSupply during normal situations
} else {
return getValueAt(totalSupplyHistory, _blockNumber);
}
}
/// @notice Generates `_amount` reputation that are assigned to `_owner`
/// @param _user The address that will be assigned the new reputation
/// @param _amount The quantity of reputation generated
/// @return True if the reputation are generated correctly
function mint(address _user, uint256 _amount) public onlyOwner returns (bool) {
uint256 curTotalSupply = totalSupply();
require(curTotalSupply + _amount >= curTotalSupply); // Check for overflow
uint256 previousBalanceTo = balanceOf(_user);
require(previousBalanceTo + _amount >= previousBalanceTo); // Check for overflow
updateValueAtNow(totalSupplyHistory, curTotalSupply + _amount);
updateValueAtNow(balances[_user], previousBalanceTo + _amount);
emit Mint(_user, _amount);
return true;
}
/// @notice Burns `_amount` reputation from `_owner`
/// @param _user The address that will lose the reputation
/// @param _amount The quantity of reputation to burn
/// @return True if the reputation are burned correctly
function burn(address _user, uint256 _amount) public onlyOwner returns (bool) {
uint256 curTotalSupply = totalSupply();
uint256 amountBurned = _amount;
uint256 previousBalanceFrom = balanceOf(_user);
if (previousBalanceFrom < amountBurned) {
amountBurned = previousBalanceFrom;
}
updateValueAtNow(totalSupplyHistory, curTotalSupply - amountBurned);
updateValueAtNow(balances[_user], previousBalanceFrom - amountBurned);
emit Burn(_user, amountBurned);
return true;
}
////////////////
// Internal helper functions to query and set a value in a snapshot array
////////////////
/// @dev `getValueAt` retrieves the number of reputation at a given block number
/// @param checkpoints The history of values being queried
/// @param _block The block number to retrieve the value at
/// @return The number of reputation being queried
function getValueAt(Checkpoint[] storage checkpoints, uint256 _block) internal view returns (uint256) {
if (checkpoints.length == 0) {
return 0;
}
// Shortcut for the actual value
if (_block >= checkpoints[checkpoints.length-1].fromBlock) {
return checkpoints[checkpoints.length-1].value;
}
if (_block < checkpoints[0].fromBlock) {
return 0;
}
// Binary search of the value in the array
uint256 min = 0;
uint256 max = checkpoints.length-1;
while (max > min) {
uint256 mid = (max + min + 1) / 2;
if (checkpoints[mid].fromBlock<=_block) {
min = mid;
} else {
max = mid-1;
}
}
return checkpoints[min].value;
}
/// @dev `updateValueAtNow` used to update the `balances` map and the
/// `totalSupplyHistory`
/// @param checkpoints The history of data being updated
/// @param _value The new number of reputation
function updateValueAtNow(Checkpoint[] storage checkpoints, uint256 _value) internal {
require(uint128(_value) == _value); //check value is in the 128 bits bounderies
if ((checkpoints.length == 0) || (checkpoints[checkpoints.length - 1].fromBlock < block.number)) {
Checkpoint storage newCheckPoint = checkpoints[checkpoints.length++];
newCheckPoint.fromBlock = uint128(block.number);
newCheckPoint.value = uint128(_value);
} else {
Checkpoint storage oldCheckPoint = checkpoints[checkpoints.length-1];
oldCheckPoint.value = uint128(_value);
}
}
}
// File: openzeppelin-solidity/contracts/token/ERC20/IERC20.sol
pragma solidity ^0.5.0;
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
interface IERC20 {
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
// File: openzeppelin-solidity/contracts/token/ERC20/ERC20.sol
pragma solidity ^0.5.0;
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
* Originally based on code by FirstBlood:
* https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*
* This implementation emits additional Approval events, allowing applications to reconstruct the allowance status for
* all accounts just by listening to said events. Note that this isn't required by the specification, and other
* compliant implementations may not do it.
*/
contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowed;
uint256 private _totalSupply;
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return _totalSupply;
}
/**
* @dev Gets the balance of the specified address.
* @param owner The address to query 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];
}
/**
* @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 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) {
_transfer(msg.sender, 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) {
require(spender != address(0));
_allowed[msg.sender][spender] = value;
emit Approval(msg.sender, spender, value);
return true;
}
/**
* @dev Transfer tokens from one address to another.
* Note that while this function emits an Approval event, this is not required as per the specification,
* and other compliant implementations may not emit the event.
* @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) {
_allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value);
_transfer(from, to, value);
emit Approval(from, msg.sender, _allowed[from][msg.sender]);
return true;
}
/**
* @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
* Emits an Approval event.
* @param spender The address which will spend the funds.
* @param addedValue The amount of tokens to increase the allowance by.
*/
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
require(spender != address(0));
_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
* Emits an Approval event.
* @param spender The address which will spend the funds.
* @param subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
require(spender != address(0));
_allowed[msg.sender][spender] = _allowed[msg.sender][spender].sub(subtractedValue);
emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);
return true;
}
/**
* @dev Transfer token for a specified addresses
* @param from The address to transfer from.
* @param to The address to transfer to.
* @param value The amount to be transferred.
*/
function _transfer(address from, address to, uint256 value) internal {
require(to != address(0));
_balances[from] = _balances[from].sub(value);
_balances[to] = _balances[to].add(value);
emit Transfer(from, to, value);
}
/**
* @dev Internal function that mints an amount of the token and assigns it to
* an account. This encapsulates the modification of balances such that the
* proper events are emitted.
* @param account The account that will receive the created tokens.
* @param value The amount that will be created.
*/
function _mint(address account, uint256 value) internal {
require(account != address(0));
_totalSupply = _totalSupply.add(value);
_balances[account] = _balances[account].add(value);
emit Transfer(address(0), account, value);
}
/**
* @dev Internal function that burns an amount of the token of a given
* account.
* @param account The account whose tokens will be burnt.
* @param value The amount that will be burnt.
*/
function _burn(address account, uint256 value) internal {
require(account != address(0));
_totalSupply = _totalSupply.sub(value);
_balances[account] = _balances[account].sub(value);
emit Transfer(account, address(0), value);
}
/**
* @dev Internal function that burns an amount of the token of a given
* account, deducting from the sender's allowance for said account. Uses the
* internal burn function.
* Emits an Approval event (reflecting the reduced allowance).
* @param account The account whose tokens will be burnt.
* @param value The amount that will be burnt.
*/
function _burnFrom(address account, uint256 value) internal {
_allowed[account][msg.sender] = _allowed[account][msg.sender].sub(value);
_burn(account, value);
emit Approval(account, msg.sender, _allowed[account][msg.sender]);
}
}
// File: openzeppelin-solidity/contracts/token/ERC20/ERC20Burnable.sol
pragma solidity ^0.5.0;
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract ERC20Burnable is ERC20 {
/**
* @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);
}
/**
* @dev Burns a specific amount of tokens from the target address and decrements allowance
* @param from address The address which you want to send tokens from
* @param value uint256 The amount of token to be burned
*/
function burnFrom(address from, uint256 value) public {
_burnFrom(from, value);
}
}
// File: @daostack/arc/contracts/controller/DAOToken.sol
pragma solidity ^0.5.4;
/**
* @title DAOToken, base on zeppelin contract.
* @dev ERC20 compatible token. It is a mintable, burnable token.
*/
contract DAOToken is ERC20, ERC20Burnable, Ownable {
string public name;
string public symbol;
// solhint-disable-next-line const-name-snakecase
uint8 public constant decimals = 18;
uint256 public cap;
/**
* @dev Constructor
* @param _name - token name
* @param _symbol - token symbol
* @param _cap - token cap - 0 value means no cap
*/
constructor(string memory _name, string memory _symbol, uint256 _cap)
public {
name = _name;
symbol = _symbol;
cap = _cap;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
*/
function mint(address _to, uint256 _amount) public onlyOwner returns (bool) {
if (cap > 0)
require(totalSupply().add(_amount) <= cap);
_mint(_to, _amount);
return true;
}
}
// File: openzeppelin-solidity/contracts/utils/Address.sol
pragma solidity ^0.5.0;
/**
* Utility library of inline functions on addresses
*/
library Address {
/**
* 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 account address of the account to check
* @return whether the target address is a contract
*/
function isContract(address account) 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.
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
}
// File: @daostack/arc/contracts/libs/SafeERC20.sol
/*
SafeERC20 by daostack.
The code is based on a fix by SECBIT Team.
USE WITH CAUTION & NO WARRANTY
REFERENCE & RELATED READING
- https://github.com/ethereum/solidity/issues/4116
- https://medium.com/@chris_77367/explaining-unexpected-reverts-starting-with-solidity-0-4-22-3ada6e82308c
- https://medium.com/coinmonks/missing-return-value-bug-at-least-130-tokens-affected-d67bf08521ca
- https://gist.github.com/BrendanChou/88a2eeb80947ff00bcf58ffdafeaeb61
*/
pragma solidity ^0.5.4;
library SafeERC20 {
using Address for address;
bytes4 constant private TRANSFER_SELECTOR = bytes4(keccak256(bytes("transfer(address,uint256)")));
bytes4 constant private TRANSFERFROM_SELECTOR = bytes4(keccak256(bytes("transferFrom(address,address,uint256)")));
bytes4 constant private APPROVE_SELECTOR = bytes4(keccak256(bytes("approve(address,uint256)")));
function safeTransfer(address _erc20Addr, address _to, uint256 _value) internal {
// Must be a contract addr first!
require(_erc20Addr.isContract());
(bool success, bytes memory returnValue) =
// solhint-disable-next-line avoid-low-level-calls
_erc20Addr.call(abi.encodeWithSelector(TRANSFER_SELECTOR, _to, _value));
// call return false when something wrong
require(success);
//check return value
require(returnValue.length == 0 || (returnValue.length == 32 && (returnValue[31] != 0)));
}
function safeTransferFrom(address _erc20Addr, address _from, address _to, uint256 _value) internal {
// Must be a contract addr first!
require(_erc20Addr.isContract());
(bool success, bytes memory returnValue) =
// solhint-disable-next-line avoid-low-level-calls
_erc20Addr.call(abi.encodeWithSelector(TRANSFERFROM_SELECTOR, _from, _to, _value));
// call return false when something wrong
require(success);
//check return value
require(returnValue.length == 0 || (returnValue.length == 32 && (returnValue[31] != 0)));
}
function safeApprove(address _erc20Addr, address _spender, uint256 _value) internal {
// Must be a contract addr first!
require(_erc20Addr.isContract());
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero.
require((_value == 0) || (IERC20(_erc20Addr).allowance(address(this), _spender) == 0));
(bool success, bytes memory returnValue) =
// solhint-disable-next-line avoid-low-level-calls
_erc20Addr.call(abi.encodeWithSelector(APPROVE_SELECTOR, _spender, _value));
// call return false when something wrong
require(success);
//check return value
require(returnValue.length == 0 || (returnValue.length == 32 && (returnValue[31] != 0)));
}
}
// File: @daostack/arc/contracts/controller/Avatar.sol
pragma solidity ^0.5.4;
/**
* @title An Avatar holds tokens, reputation and ether for a controller
*/
contract Avatar is Ownable {
using SafeERC20 for address;
string public orgName;
DAOToken public nativeToken;
Reputation public nativeReputation;
event GenericCall(address indexed _contract, bytes _data, uint _value, bool _success);
event SendEther(uint256 _amountInWei, address indexed _to);
event ExternalTokenTransfer(address indexed _externalToken, address indexed _to, uint256 _value);
event ExternalTokenTransferFrom(address indexed _externalToken, address _from, address _to, uint256 _value);
event ExternalTokenApproval(address indexed _externalToken, address _spender, uint256 _value);
event ReceiveEther(address indexed _sender, uint256 _value);
event MetaData(string _metaData);
/**
* @dev the constructor takes organization name, native token and reputation system
and creates an avatar for a controller
*/
constructor(string memory _orgName, DAOToken _nativeToken, Reputation _nativeReputation) public {
orgName = _orgName;
nativeToken = _nativeToken;
nativeReputation = _nativeReputation;
}
/**
* @dev enables an avatar to receive ethers
*/
function() external payable {
emit ReceiveEther(msg.sender, msg.value);
}
/**
* @dev perform a generic call to an arbitrary contract
* @param _contract the contract's address to call
* @param _data ABI-encoded contract call to call `_contract` address.
* @param _value value (ETH) to transfer with the transaction
* @return bool success or fail
* bytes - the return bytes of the called contract's function.
*/
function genericCall(address _contract, bytes memory _data, uint256 _value)
public
onlyOwner
returns(bool success, bytes memory returnValue) {
// solhint-disable-next-line avoid-call-value
(success, returnValue) = _contract.call.value(_value)(_data);
emit GenericCall(_contract, _data, _value, success);
}
/**
* @dev send ethers from the avatar's wallet
* @param _amountInWei amount to send in Wei units
* @param _to send the ethers to this address
* @return bool which represents success
*/
function sendEther(uint256 _amountInWei, address payable _to) public onlyOwner returns(bool) {
_to.transfer(_amountInWei);
emit SendEther(_amountInWei, _to);
return true;
}
/**
* @dev external token transfer
* @param _externalToken the token contract
* @param _to the destination address
* @param _value the amount of tokens to transfer
* @return bool which represents success
*/
function externalTokenTransfer(IERC20 _externalToken, address _to, uint256 _value)
public onlyOwner returns(bool)
{
address(_externalToken).safeTransfer(_to, _value);
emit ExternalTokenTransfer(address(_externalToken), _to, _value);
return true;
}
/**
* @dev external token transfer from a specific account
* @param _externalToken the token contract
* @param _from the account to spend token from
* @param _to the destination address
* @param _value the amount of tokens to transfer
* @return bool which represents success
*/
function externalTokenTransferFrom(
IERC20 _externalToken,
address _from,
address _to,
uint256 _value
)
public onlyOwner returns(bool)
{
address(_externalToken).safeTransferFrom(_from, _to, _value);
emit ExternalTokenTransferFrom(address(_externalToken), _from, _to, _value);
return true;
}
/**
* @dev externalTokenApproval approve the spender address to spend a specified amount of tokens
* on behalf of msg.sender.
* @param _externalToken the address of the Token Contract
* @param _spender address
* @param _value the amount of ether (in Wei) which the approval is referring to.
* @return bool which represents a success
*/
function externalTokenApproval(IERC20 _externalToken, address _spender, uint256 _value)
public onlyOwner returns(bool)
{
address(_externalToken).safeApprove(_spender, _value);
emit ExternalTokenApproval(address(_externalToken), _spender, _value);
return true;
}
/**
* @dev metaData emits an event with a string, should contain the hash of some meta data.
* @param _metaData a string representing a hash of the meta data
* @return bool which represents a success
*/
function metaData(string memory _metaData) public onlyOwner returns(bool) {
emit MetaData(_metaData);
return true;
}
}
// File: @daostack/arc/contracts/globalConstraints/GlobalConstraintInterface.sol
pragma solidity ^0.5.4;
contract GlobalConstraintInterface {
enum CallPhase { Pre, Post, PreAndPost }
function pre( address _scheme, bytes32 _params, bytes32 _method ) public returns(bool);
function post( address _scheme, bytes32 _params, bytes32 _method ) public returns(bool);
/**
* @dev when return if this globalConstraints is pre, post or both.
* @return CallPhase enum indication Pre, Post or PreAndPost.
*/
function when() public returns(CallPhase);
}
// File: @daostack/arc/contracts/controller/ControllerInterface.sol
pragma solidity ^0.5.4;
/**
* @title Controller contract
* @dev A controller controls the organizations tokens ,reputation and avatar.
* It is subject to a set of schemes and constraints that determine its behavior.
* Each scheme has it own parameters and operation permissions.
*/
interface ControllerInterface {
/**
* @dev Mint `_amount` of reputation that are assigned to `_to` .
* @param _amount amount of reputation to mint
* @param _to beneficiary address
* @return bool which represents a success
*/
function mintReputation(uint256 _amount, address _to, address _avatar)
external
returns(bool);
/**
* @dev Burns `_amount` of reputation from `_from`
* @param _amount amount of reputation to burn
* @param _from The address that will lose the reputation
* @return bool which represents a success
*/
function burnReputation(uint256 _amount, address _from, address _avatar)
external
returns(bool);
/**
* @dev mint tokens .
* @param _amount amount of token to mint
* @param _beneficiary beneficiary address
* @param _avatar address
* @return bool which represents a success
*/
function mintTokens(uint256 _amount, address _beneficiary, address _avatar)
external
returns(bool);
/**
* @dev register or update a scheme
* @param _scheme the address of the scheme
* @param _paramsHash a hashed configuration of the usage of the scheme
* @param _permissions the permissions the new scheme will have
* @param _avatar address
* @return bool which represents a success
*/
function registerScheme(address _scheme, bytes32 _paramsHash, bytes4 _permissions, address _avatar)
external
returns(bool);
/**
* @dev unregister a scheme
* @param _avatar address
* @param _scheme the address of the scheme
* @return bool which represents a success
*/
function unregisterScheme(address _scheme, address _avatar)
external
returns(bool);
/**
* @dev unregister the caller's scheme
* @param _avatar address
* @return bool which represents a success
*/
function unregisterSelf(address _avatar) external returns(bool);
/**
* @dev add or update Global Constraint
* @param _globalConstraint the address of the global constraint to be added.
* @param _params the constraint parameters hash.
* @param _avatar the avatar of the organization
* @return bool which represents a success
*/
function addGlobalConstraint(address _globalConstraint, bytes32 _params, address _avatar)
external returns(bool);
/**
* @dev remove Global Constraint
* @param _globalConstraint the address of the global constraint to be remove.
* @param _avatar the organization avatar.
* @return bool which represents a success
*/
function removeGlobalConstraint (address _globalConstraint, address _avatar)
external returns(bool);
/**
* @dev upgrade the Controller
* The function will trigger an event 'UpgradeController'.
* @param _newController the address of the new controller.
* @param _avatar address
* @return bool which represents a success
*/
function upgradeController(address _newController, Avatar _avatar)
external returns(bool);
/**
* @dev perform a generic call to an arbitrary contract
* @param _contract the contract's address to call
* @param _data ABI-encoded contract call to call `_contract` address.
* @param _avatar the controller's avatar address
* @param _value value (ETH) to transfer with the transaction
* @return bool -success
* bytes - the return value of the called _contract's function.
*/
function genericCall(address _contract, bytes calldata _data, Avatar _avatar, uint256 _value)
external
returns(bool, bytes memory);
/**
* @dev send some ether
* @param _amountInWei the amount of ether (in Wei) to send
* @param _to address of the beneficiary
* @param _avatar address
* @return bool which represents a success
*/
function sendEther(uint256 _amountInWei, address payable _to, Avatar _avatar)
external returns(bool);
/**
* @dev send some amount of arbitrary ERC20 Tokens
* @param _externalToken the address of the Token Contract
* @param _to address of the beneficiary
* @param _value the amount of ether (in Wei) to send
* @param _avatar address
* @return bool which represents a success
*/
function externalTokenTransfer(IERC20 _externalToken, address _to, uint256 _value, Avatar _avatar)
external
returns(bool);
/**
* @dev transfer token "from" address "to" address
* One must to approve the amount of tokens which can be spend from the
* "from" account.This can be done using externalTokenApprove.
* @param _externalToken the address of the Token Contract
* @param _from address of the account to send from
* @param _to address of the beneficiary
* @param _value the amount of ether (in Wei) to send
* @param _avatar address
* @return bool which represents a success
*/
function externalTokenTransferFrom(
IERC20 _externalToken,
address _from,
address _to,
uint256 _value,
Avatar _avatar)
external
returns(bool);
/**
* @dev externalTokenApproval approve the spender address to spend a specified amount of tokens
* on behalf of msg.sender.
* @param _externalToken the address of the Token Contract
* @param _spender address
* @param _value the amount of ether (in Wei) which the approval is referring to.
* @return bool which represents a success
*/
function externalTokenApproval(IERC20 _externalToken, address _spender, uint256 _value, Avatar _avatar)
external
returns(bool);
/**
* @dev metaData emits an event with a string, should contain the hash of some meta data.
* @param _metaData a string representing a hash of the meta data
* @param _avatar Avatar
* @return bool which represents a success
*/
function metaData(string calldata _metaData, Avatar _avatar) external returns(bool);
/**
* @dev getNativeReputation
* @param _avatar the organization avatar.
* @return organization native reputation
*/
function getNativeReputation(address _avatar)
external
view
returns(address);
function isSchemeRegistered( address _scheme, address _avatar) external view returns(bool);
function getSchemeParameters(address _scheme, address _avatar) external view returns(bytes32);
function getGlobalConstraintParameters(address _globalConstraint, address _avatar) external view returns(bytes32);
function getSchemePermissions(address _scheme, address _avatar) external view returns(bytes4);
/**
* @dev globalConstraintsCount return the global constraint pre and post count
* @return uint256 globalConstraintsPre count.
* @return uint256 globalConstraintsPost count.
*/
function globalConstraintsCount(address _avatar) external view returns(uint, uint);
function isGlobalConstraintRegistered(address _globalConstraint, address _avatar) external view returns(bool);
}
// File: @daostack/arc/contracts/schemes/Auction4Reputation.sol
pragma solidity ^0.5.4;
/**
* @title A scheme for conduct ERC20 Tokens auction for reputation
*/
contract Auction4Reputation is Ownable {
using SafeMath for uint256;
using SafeERC20 for address;
event Bid(address indexed _bidder, uint256 indexed _auctionId, uint256 _amount);
event Redeem(uint256 indexed _auctionId, address indexed _beneficiary, uint256 _amount);
struct Auction {
uint256 totalBid;
// A mapping from bidder addresses to their bids.
mapping(address=>uint) bids;
}
// A mapping from auction index to auction.
mapping(uint=>Auction) public auctions;
Avatar public avatar;
uint256 public reputationRewardLeft;
uint256 public auctionsEndTime;
uint256 public auctionsStartTime;
uint256 public numberOfAuctions;
uint256 public auctionReputationReward;
uint256 public auctionPeriod;
uint256 public redeemEnableTime;
IERC20 public token;
address public wallet;
/**
* @dev initialize
* @param _avatar the avatar to mint reputation from
* @param _auctionReputationReward the reputation reward per auction this contract will reward
* for the token locking
* @param _auctionsStartTime auctions period start time
* @param _auctionPeriod auctions period time.
* auctionsEndTime is set to _auctionsStartTime + _auctionPeriod*_numberOfAuctions
* bidding is disable after auctionsEndTime.
* @param _numberOfAuctions number of auctions.
* @param _redeemEnableTime redeem enable time .
* redeem reputation can be done after this time.
* @param _token the bidding token
* @param _wallet the address of the wallet the token will be transfer to.
* Please note that _wallet address should be a trusted account.
* Normally this address should be set as the DAO's avatar address.
*/
function initialize(
Avatar _avatar,
uint256 _auctionReputationReward,
uint256 _auctionsStartTime,
uint256 _auctionPeriod,
uint256 _numberOfAuctions,
uint256 _redeemEnableTime,
IERC20 _token,
address _wallet)
external
{
require(avatar == Avatar(0), "can be called only one time");
require(_avatar != Avatar(0), "avatar cannot be zero");
require(_numberOfAuctions > 0, "number of auctions cannot be zero");
//_auctionPeriod should be greater than block interval
require(_auctionPeriod > 15, "auctionPeriod should be > 15");
auctionPeriod = _auctionPeriod;
auctionsEndTime = _auctionsStartTime + _auctionPeriod.mul(_numberOfAuctions);
require(_redeemEnableTime >= auctionsEndTime, "_redeemEnableTime >= auctionsEndTime");
token = _token;
avatar = _avatar;
auctionsStartTime = _auctionsStartTime;
numberOfAuctions = _numberOfAuctions;
wallet = _wallet;
auctionReputationReward = _auctionReputationReward;
reputationRewardLeft = _auctionReputationReward.mul(_numberOfAuctions);
redeemEnableTime = _redeemEnableTime;
}
/**
* @dev redeem reputation function
* @param _beneficiary the beneficiary to redeem.
* @param _auctionId the auction id to redeem from.
* @return uint256 reputation rewarded
*/
function redeem(address _beneficiary, uint256 _auctionId) public returns(uint256 reputation) {
// solhint-disable-next-line not-rely-on-time
require(now > redeemEnableTime, "now > redeemEnableTime");
Auction storage auction = auctions[_auctionId];
uint256 bid = auction.bids[_beneficiary];
require(bid > 0, "bidding amount should be > 0");
auction.bids[_beneficiary] = 0;
uint256 repRelation = bid.mul(auctionReputationReward);
reputation = repRelation.div(auction.totalBid);
// check that the reputation is sum zero
reputationRewardLeft = reputationRewardLeft.sub(reputation);
require(
ControllerInterface(avatar.owner())
.mintReputation(reputation, _beneficiary, address(avatar)), "mint reputation should succeed");
emit Redeem(_auctionId, _beneficiary, reputation);
}
/**
* @dev bid function
* @param _amount the amount to bid with
* @param _auctionId the auction id to bid at .
* @return auctionId
*/
function bid(uint256 _amount, uint256 _auctionId) public returns(uint256 auctionId) {
require(_amount > 0, "bidding amount should be > 0");
// solhint-disable-next-line not-rely-on-time
require(now < auctionsEndTime, "bidding should be within the allowed bidding period");
// solhint-disable-next-line not-rely-on-time
require(now >= auctionsStartTime, "bidding is enable only after bidding auctionsStartTime");
address(token).safeTransferFrom(msg.sender, address(this), _amount);
// solhint-disable-next-line not-rely-on-time
auctionId = (now - auctionsStartTime) / auctionPeriod;
require(auctionId == _auctionId, "auction is not active");
Auction storage auction = auctions[auctionId];
auction.totalBid = auction.totalBid.add(_amount);
auction.bids[msg.sender] = auction.bids[msg.sender].add(_amount);
emit Bid(msg.sender, auctionId, _amount);
}
/**
* @dev getBid get bid for specific bidder and _auctionId
* @param _bidder the bidder
* @param _auctionId auction id
* @return uint
*/
function getBid(address _bidder, uint256 _auctionId) public view returns(uint256) {
return auctions[_auctionId].bids[_bidder];
}
/**
* @dev transferToWallet transfer the tokens to the wallet.
* can be called only after auctionsEndTime
*/
function transferToWallet() public {
// solhint-disable-next-line not-rely-on-time
require(now > auctionsEndTime, "now > auctionsEndTime");
uint256 tokenBalance = token.balanceOf(address(this));
address(token).safeTransfer(wallet, tokenBalance);
}
}
// File: contracts/schemes/bootstrap/DxGenAuction4Rep.sol
pragma solidity ^0.5.4;
/**
* @title Scheme for conducting ERC20 Tokens auctions for reputation
*/
contract DxGenAuction4Rep is Auction4Reputation {
constructor() public {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"constant":true,"inputs":[],"name":"auctionPeriod","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"auctionReputationReward","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_bidder","type":"address"},{"name":"_auctionId","type":"uint256"}],"name":"getBid","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_beneficiary","type":"address"},{"name":"_auctionId","type":"uint256"}],"name":"redeem","outputs":[{"name":"reputation","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_avatar","type":"address"},{"name":"_auctionReputationReward","type":"uint256"},{"name":"_auctionsStartTime","type":"uint256"},{"name":"_auctionPeriod","type":"uint256"},{"name":"_numberOfAuctions","type":"uint256"},{"name":"_redeemEnableTime","type":"uint256"},{"name":"_token","type":"address"},{"name":"_wallet","type":"address"}],"name":"initialize","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"redeemEnableTime","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"transferToWallet","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"numberOfAuctions","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"wallet","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"auctionsEndTime","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"auctions","outputs":[{"name":"totalBid","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_amount","type":"uint256"},{"name":"_auctionId","type":"uint256"}],"name":"bid","outputs":[{"name":"auctionId","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"avatar","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"renounceOwnership","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":"isOwner","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"auctionsStartTime","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"reputationRewardLeft","outputs":[{"name":"","type":"uint256"}],"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":"token","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_bidder","type":"address"},{"indexed":true,"name":"_auctionId","type":"uint256"},{"indexed":false,"name":"_amount","type":"uint256"}],"name":"Bid","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_auctionId","type":"uint256"},{"indexed":true,"name":"_beneficiary","type":"address"},{"indexed":false,"name":"_amount","type":"uint256"}],"name":"Redeem","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"},{"indexed":true,"name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"}]Contract Creation Code
0x608060405234801561001057600080fd5b5060008054600160a060020a0319163317808255604051600160a060020a039190911691907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3611286806100696000396000f3fe608060405234801561001057600080fd5b5060043610610149576000357c010000000000000000000000000000000000000000000000000000000090048063571a26a0116100ca5780638f32d59b1161008e5780638f32d59b146102bb5780639abc03d2146102d7578063afe0e33c146102df578063f2fde38b146102e7578063fc0c546a1461030d57610149565b8063571a26a014610263578063598647f8146102805780635aef7de6146102a3578063715018a6146102ab5780638da5cb5b146102b357610149565b80633d1678f4116101115780633d1678f41461021f5780634870b81d1461022757806350d9d4721461022f578063521eb2731461023757806356e492871461025b57610149565b80630cccfc581461014e57806311c4dbf41461016857806316ab2b03146101705780631e9a69501461019c5780632737033f146101c8575b600080fd5b610156610315565b60408051918252519081900360200190f35b61015661031b565b6101566004803603604081101561018657600080fd5b50600160a060020a038135169060200135610321565b610156600480360360408110156101b257600080fd5b50600160a060020a03813516906020013561034d565b61021d60048036036101008110156101df57600080fd5b50600160a060020a03813581169160208101359160408201359160608101359160808201359160a08101359160c082013581169160e0013516610653565b005b610156610883565b61021d610889565b61015661099b565b61023f6109a1565b60408051600160a060020a039092168252519081900360200190f35b6101566109b0565b6101566004803603602081101561027957600080fd5b50356109b6565b6101566004803603604081101561029657600080fd5b50803590602001356109c8565b61023f610bc6565b61021d610bd5565b61023f610c3f565b6102c3610c4e565b604080519115158252519081900360200190f35b610156610c5f565b610156610c65565b61021d600480360360208110156102fd57600080fd5b5035600160a060020a0316610c6b565b61023f610c87565b60085481565b60075481565b6000818152600160208181526040808420600160a060020a038716855290920190529020545b92915050565b60095460009042116103a9576040805160e560020a62461bcd02815260206004820152601660248201527f6e6f77203e2072656465656d456e61626c6554696d6500000000000000000000604482015290519081900360640190fd5b6000828152600160208181526040808420600160a060020a038816855292830190915282205490918111610427576040805160e560020a62461bcd02815260206004820152601c60248201527f62696464696e6720616d6f756e742073686f756c64206265203e203000000000604482015290519081900360640190fd5b600160a060020a0385166000908152600183016020526040812081905560075461045890839063ffffffff610c9616565b835490915061046e90829063ffffffff610cc816565b600354909450610484908563ffffffff610cec16565b600355600254604080517f8da5cb5b0000000000000000000000000000000000000000000000000000000081529051600160a060020a0390921691638da5cb5b91600480820192602092909190829003018186803b1580156104e557600080fd5b505afa1580156104f9573d6000803e3d6000fd5b505050506040513d602081101561050f57600080fd5b5051600254604080517feaf994b200000000000000000000000000000000000000000000000000000000815260048101889052600160a060020a038a8116602483015292831660448201529051919092169163eaf994b29160648083019260209291908290030181600087803b15801561058857600080fd5b505af115801561059c573d6000803e3d6000fd5b505050506040513d60208110156105b257600080fd5b5051151561060a576040805160e560020a62461bcd02815260206004820152601e60248201527f6d696e742072657075746174696f6e2073686f756c6420737563636565640000604482015290519081900360640190fd5b604080518581529051600160a060020a0388169187917f1069ba7d3dd3d969eada9a014b1e1a8e2ab1ef7f38989db8ce98e698ac844f659181900360200190a350505092915050565b600254600160a060020a0316156106b4576040805160e560020a62461bcd02815260206004820152601b60248201527f63616e2062652063616c6c6564206f6e6c79206f6e652074696d650000000000604482015290519081900360640190fd5b600160a060020a0388161515610714576040805160e560020a62461bcd02815260206004820152601560248201527f6176617461722063616e6e6f74206265207a65726f0000000000000000000000604482015290519081900360640190fd5b600084116107565760405160e560020a62461bcd02815260040180806020018281038252602181526020018061123a6021913960400191505060405180910390fd5b600f85116107ae576040805160e560020a62461bcd02815260206004820152601c60248201527f61756374696f6e506572696f642073686f756c64206265203e20313500000000604482015290519081900360640190fd5b60088590556107c3858563ffffffff610c9616565b8601600481905583101561080b5760405160e560020a62461bcd0281526004018080602001828103825260248152602001806111bb6024913960400191505060405180910390fd5b600a8054600160a060020a0380851673ffffffffffffffffffffffffffffffffffffffff1992831617909255600280548b841690831617905560058890556006869055600b8054928416929091169190911790556007879055610874878563ffffffff610c9616565b60035550506009555050505050565b60095481565b60045442116108e2576040805160e560020a62461bcd02815260206004820152601560248201527f6e6f77203e2061756374696f6e73456e6454696d650000000000000000000000604482015290519081900360640190fd5b600a54604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600092600160a060020a0316916370a08231916024808301926020929190829003018186803b15801561094657600080fd5b505afa15801561095a573d6000803e3d6000fd5b505050506040513d602081101561097057600080fd5b5051600b54600a5491925061099891600160a060020a0390811691168363ffffffff610d0116565b50565b60065481565b600b54600160a060020a031681565b60045481565b60016020526000908152604090205481565b6000808311610a21576040805160e560020a62461bcd02815260206004820152601c60248201527f62696464696e6720616d6f756e742073686f756c64206265203e203000000000604482015290519081900360640190fd5b6004544210610a645760405160e560020a62461bcd0281526004018080602001828103825260338152602001806111886033913960400191505060405180910390fd5b600554421015610aa85760405160e560020a62461bcd0281526004018080602001828103825260368152602001806112046036913960400191505060405180910390fd5b600a54610ac690600160a060020a031633308663ffffffff610ef816565b6008546005544203811515610ad757fe5b049050818114610b31576040805160e560020a62461bcd02815260206004820152601560248201527f61756374696f6e206973206e6f74206163746976650000000000000000000000604482015290519081900360640190fd5b60008181526001602052604090208054610b51908563ffffffff6110f016565b8155336000908152600182016020526040902054610b75908563ffffffff6110f016565b336000818152600184016020908152604091829020939093558051878152905185937f19421268847f42dd61705778018ddfc43bcdce8517e7a630acb12f122c709481928290030190a35092915050565b600254600160a060020a031681565b610bdd610c4e565b1515610be857600080fd5b60008054604051600160a060020a03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a36000805473ffffffffffffffffffffffffffffffffffffffff19169055565b600054600160a060020a031690565b600054600160a060020a0316331490565b60055481565b60035481565b610c73610c4e565b1515610c7e57600080fd5b61099881611102565b600a54600160a060020a031681565b6000821515610ca757506000610347565b828202828482811515610cb657fe5b0414610cc157600080fd5b9392505050565b6000808211610cd657600080fd5b60008284811515610ce357fe5b04949350505050565b600082821115610cfb57600080fd5b50900390565b610d1383600160a060020a031661117f565b1515610d1e57600080fd5b604080518082018252601981527f7472616e7366657228616464726573732c75696e7432353629000000000000006020918201528151600160a060020a0385811660248301526044808301869052845180840390910181526064909201845291810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001781529251815160009460609489169392918291908083835b60208310610df95780518252601f199092019160209182019101610dda565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114610e5b576040519150601f19603f3d011682016040523d82523d6000602084013e610e60565b606091505b5091509150811515610e7157600080fd5b80511580610ee6575080516020148015610ee6575080601f815181101515610e9557fe5b6020910101517f010000000000000000000000000000000000000000000000000000000000000090819004027fff000000000000000000000000000000000000000000000000000000000000001615155b1515610ef157600080fd5b5050505050565b610f0a84600160a060020a031661117f565b1515610f1557600080fd5b6000606085600160a060020a0316606060405190810160405280602581526020016111df60259139805160209182012060408051600160a060020a03808b166024830152891660448201526064808201899052825180830390910181526084909101825292830180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909316929092178252518251909182918083835b60208310610ff05780518252601f199092019160209182019101610fd1565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611052576040519150601f19603f3d011682016040523d82523d6000602084013e611057565b606091505b509150915081151561106857600080fd5b805115806110dd5750805160201480156110dd575080601f81518110151561108c57fe5b6020910101517f010000000000000000000000000000000000000000000000000000000000000090819004027fff000000000000000000000000000000000000000000000000000000000000001615155b15156110e857600080fd5b505050505050565b600082820183811015610cc157600080fd5b600160a060020a038116151561111757600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6000903b119056fe62696464696e672073686f756c642062652077697468696e2074686520616c6c6f7765642062696464696e6720706572696f645f72656465656d456e61626c6554696d65203e3d2061756374696f6e73456e6454696d657472616e7366657246726f6d28616464726573732c616464726573732c75696e743235362962696464696e6720697320656e61626c65206f6e6c792061667465722062696464696e672061756374696f6e73537461727454696d656e756d626572206f662061756374696f6e732063616e6e6f74206265207a65726fa165627a7a72305820cd9a3b2139a9193f4b8715df842f0d74769c558249175acdb1d68cd03deead8a0029
Deployed Bytecode
0x608060405234801561001057600080fd5b5060043610610149576000357c010000000000000000000000000000000000000000000000000000000090048063571a26a0116100ca5780638f32d59b1161008e5780638f32d59b146102bb5780639abc03d2146102d7578063afe0e33c146102df578063f2fde38b146102e7578063fc0c546a1461030d57610149565b8063571a26a014610263578063598647f8146102805780635aef7de6146102a3578063715018a6146102ab5780638da5cb5b146102b357610149565b80633d1678f4116101115780633d1678f41461021f5780634870b81d1461022757806350d9d4721461022f578063521eb2731461023757806356e492871461025b57610149565b80630cccfc581461014e57806311c4dbf41461016857806316ab2b03146101705780631e9a69501461019c5780632737033f146101c8575b600080fd5b610156610315565b60408051918252519081900360200190f35b61015661031b565b6101566004803603604081101561018657600080fd5b50600160a060020a038135169060200135610321565b610156600480360360408110156101b257600080fd5b50600160a060020a03813516906020013561034d565b61021d60048036036101008110156101df57600080fd5b50600160a060020a03813581169160208101359160408201359160608101359160808201359160a08101359160c082013581169160e0013516610653565b005b610156610883565b61021d610889565b61015661099b565b61023f6109a1565b60408051600160a060020a039092168252519081900360200190f35b6101566109b0565b6101566004803603602081101561027957600080fd5b50356109b6565b6101566004803603604081101561029657600080fd5b50803590602001356109c8565b61023f610bc6565b61021d610bd5565b61023f610c3f565b6102c3610c4e565b604080519115158252519081900360200190f35b610156610c5f565b610156610c65565b61021d600480360360208110156102fd57600080fd5b5035600160a060020a0316610c6b565b61023f610c87565b60085481565b60075481565b6000818152600160208181526040808420600160a060020a038716855290920190529020545b92915050565b60095460009042116103a9576040805160e560020a62461bcd02815260206004820152601660248201527f6e6f77203e2072656465656d456e61626c6554696d6500000000000000000000604482015290519081900360640190fd5b6000828152600160208181526040808420600160a060020a038816855292830190915282205490918111610427576040805160e560020a62461bcd02815260206004820152601c60248201527f62696464696e6720616d6f756e742073686f756c64206265203e203000000000604482015290519081900360640190fd5b600160a060020a0385166000908152600183016020526040812081905560075461045890839063ffffffff610c9616565b835490915061046e90829063ffffffff610cc816565b600354909450610484908563ffffffff610cec16565b600355600254604080517f8da5cb5b0000000000000000000000000000000000000000000000000000000081529051600160a060020a0390921691638da5cb5b91600480820192602092909190829003018186803b1580156104e557600080fd5b505afa1580156104f9573d6000803e3d6000fd5b505050506040513d602081101561050f57600080fd5b5051600254604080517feaf994b200000000000000000000000000000000000000000000000000000000815260048101889052600160a060020a038a8116602483015292831660448201529051919092169163eaf994b29160648083019260209291908290030181600087803b15801561058857600080fd5b505af115801561059c573d6000803e3d6000fd5b505050506040513d60208110156105b257600080fd5b5051151561060a576040805160e560020a62461bcd02815260206004820152601e60248201527f6d696e742072657075746174696f6e2073686f756c6420737563636565640000604482015290519081900360640190fd5b604080518581529051600160a060020a0388169187917f1069ba7d3dd3d969eada9a014b1e1a8e2ab1ef7f38989db8ce98e698ac844f659181900360200190a350505092915050565b600254600160a060020a0316156106b4576040805160e560020a62461bcd02815260206004820152601b60248201527f63616e2062652063616c6c6564206f6e6c79206f6e652074696d650000000000604482015290519081900360640190fd5b600160a060020a0388161515610714576040805160e560020a62461bcd02815260206004820152601560248201527f6176617461722063616e6e6f74206265207a65726f0000000000000000000000604482015290519081900360640190fd5b600084116107565760405160e560020a62461bcd02815260040180806020018281038252602181526020018061123a6021913960400191505060405180910390fd5b600f85116107ae576040805160e560020a62461bcd02815260206004820152601c60248201527f61756374696f6e506572696f642073686f756c64206265203e20313500000000604482015290519081900360640190fd5b60088590556107c3858563ffffffff610c9616565b8601600481905583101561080b5760405160e560020a62461bcd0281526004018080602001828103825260248152602001806111bb6024913960400191505060405180910390fd5b600a8054600160a060020a0380851673ffffffffffffffffffffffffffffffffffffffff1992831617909255600280548b841690831617905560058890556006869055600b8054928416929091169190911790556007879055610874878563ffffffff610c9616565b60035550506009555050505050565b60095481565b60045442116108e2576040805160e560020a62461bcd02815260206004820152601560248201527f6e6f77203e2061756374696f6e73456e6454696d650000000000000000000000604482015290519081900360640190fd5b600a54604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600092600160a060020a0316916370a08231916024808301926020929190829003018186803b15801561094657600080fd5b505afa15801561095a573d6000803e3d6000fd5b505050506040513d602081101561097057600080fd5b5051600b54600a5491925061099891600160a060020a0390811691168363ffffffff610d0116565b50565b60065481565b600b54600160a060020a031681565b60045481565b60016020526000908152604090205481565b6000808311610a21576040805160e560020a62461bcd02815260206004820152601c60248201527f62696464696e6720616d6f756e742073686f756c64206265203e203000000000604482015290519081900360640190fd5b6004544210610a645760405160e560020a62461bcd0281526004018080602001828103825260338152602001806111886033913960400191505060405180910390fd5b600554421015610aa85760405160e560020a62461bcd0281526004018080602001828103825260368152602001806112046036913960400191505060405180910390fd5b600a54610ac690600160a060020a031633308663ffffffff610ef816565b6008546005544203811515610ad757fe5b049050818114610b31576040805160e560020a62461bcd02815260206004820152601560248201527f61756374696f6e206973206e6f74206163746976650000000000000000000000604482015290519081900360640190fd5b60008181526001602052604090208054610b51908563ffffffff6110f016565b8155336000908152600182016020526040902054610b75908563ffffffff6110f016565b336000818152600184016020908152604091829020939093558051878152905185937f19421268847f42dd61705778018ddfc43bcdce8517e7a630acb12f122c709481928290030190a35092915050565b600254600160a060020a031681565b610bdd610c4e565b1515610be857600080fd5b60008054604051600160a060020a03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a36000805473ffffffffffffffffffffffffffffffffffffffff19169055565b600054600160a060020a031690565b600054600160a060020a0316331490565b60055481565b60035481565b610c73610c4e565b1515610c7e57600080fd5b61099881611102565b600a54600160a060020a031681565b6000821515610ca757506000610347565b828202828482811515610cb657fe5b0414610cc157600080fd5b9392505050565b6000808211610cd657600080fd5b60008284811515610ce357fe5b04949350505050565b600082821115610cfb57600080fd5b50900390565b610d1383600160a060020a031661117f565b1515610d1e57600080fd5b604080518082018252601981527f7472616e7366657228616464726573732c75696e7432353629000000000000006020918201528151600160a060020a0385811660248301526044808301869052845180840390910181526064909201845291810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001781529251815160009460609489169392918291908083835b60208310610df95780518252601f199092019160209182019101610dda565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114610e5b576040519150601f19603f3d011682016040523d82523d6000602084013e610e60565b606091505b5091509150811515610e7157600080fd5b80511580610ee6575080516020148015610ee6575080601f815181101515610e9557fe5b6020910101517f010000000000000000000000000000000000000000000000000000000000000090819004027fff000000000000000000000000000000000000000000000000000000000000001615155b1515610ef157600080fd5b5050505050565b610f0a84600160a060020a031661117f565b1515610f1557600080fd5b6000606085600160a060020a0316606060405190810160405280602581526020016111df60259139805160209182012060408051600160a060020a03808b166024830152891660448201526064808201899052825180830390910181526084909101825292830180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909316929092178252518251909182918083835b60208310610ff05780518252601f199092019160209182019101610fd1565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611052576040519150601f19603f3d011682016040523d82523d6000602084013e611057565b606091505b509150915081151561106857600080fd5b805115806110dd5750805160201480156110dd575080601f81518110151561108c57fe5b6020910101517f010000000000000000000000000000000000000000000000000000000000000090819004027fff000000000000000000000000000000000000000000000000000000000000001615155b15156110e857600080fd5b505050505050565b600082820183811015610cc157600080fd5b600160a060020a038116151561111757600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6000903b119056fe62696464696e672073686f756c642062652077697468696e2074686520616c6c6f7765642062696464696e6720706572696f645f72656465656d456e61626c6554696d65203e3d2061756374696f6e73456e6454696d657472616e7366657246726f6d28616464726573732c616464726573732c75696e743235362962696464696e6720697320656e61626c65206f6e6c792061667465722062696464696e672061756374696f6e73537461727454696d656e756d626572206f662061756374696f6e732063616e6e6f74206265207a65726fa165627a7a72305820cd9a3b2139a9193f4b8715df842f0d74769c558249175acdb1d68cd03deead8a0029
Swarm Source
bzzr://cd9a3b2139a9193f4b8715df842f0d74769c558249175acdb1d68cd03deead8a
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 34 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
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.