Address Contract Partially Verified
Address
0xd50c1746D835d2770dDA3703B69187bFfeB14126
Balance
0 ETH
Nonce
1
Code Size
4160 bytes
Creator
0xDe910777...B1Fe at tx 0xbcdcafb2...5356d2
Indexed Transactions
0
Contract Bytecode
4160 bytes
0x6080604052600436106100fb5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146101d0578063095ea7b31461025a5780631627540c1461029257806318160ddd146102b357806323b872dd146102da578063313ce5671461030457806353a47bb71461032f57806370a0823114610360578063776d1a011461038157806379ba5097146103a25780638da5cb5b146103b7578063907dff97146103cc57806395578ebd146103fc57806395d89b4114610411578063a9059cbb14610426578063befff6af1461044a578063d4b8399214610464578063dd62ed3e14610479575b60025474010000000000000000000000000000000000000000900460ff161561014457604051366000823760008036836002545af43d6000833e801515610140573d82fd5b3d82f35b6002546040805160e160020a635e33fc190281523360048201529051600160a060020a039092169163bc67f8329160248082019260009290919082900301818387803b15801561019357600080fd5b505af11580156101a7573d6000803e3d6000fd5b5050505060405136600082376000803683346002545af13d6000833e801515610140573d82fd5b005b3480156101dc57600080fd5b506101e56104a0565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561021f578181015183820152602001610207565b50505050905090810190601f16801561024c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561026657600080fd5b5061027e600160a060020a036004351660243561058c565b604080519115158252519081900360200190f35b34801561029e57600080fd5b506101ce600160a060020a0360043516610696565b3480156102bf57600080fd5b506102c861077f565b60408051918252519081900360200190f35b3480156102e657600080fd5b5061027e600160a060020a036004358116906024351660443561080f565b34801561031057600080fd5b50610319610922565b6040805160ff9092168252519081900360200190f35b34801561033b57600080fd5b50610344610981565b60408051600160a060020a039092168252519081900360200190f35b34801561036c57600080fd5b506102c8600160a060020a0360043516610990565b34801561038d57600080fd5b506101ce600160a060020a0360043516610a2d565b3480156103ae57600080fd5b506101ce610b16565b3480156103c357600080fd5b50610344610c1e565b3480156103d857600080fd5b506101ce60246004803582810192910135903560443560643560843560a435610c2d565b34801561040857600080fd5b5061027e610d42565b34801561041d57600080fd5b506101e5610d63565b34801561043257600080fd5b5061027e600160a060020a0360043516602435610dc2565b34801561045657600080fd5b506101ce6004351515610e97565b34801561047057600080fd5b50610344610f5f565b34801561048557600080fd5b506102c8600160a060020a0360043581169060243516610f6e565b600254604080517f06fdde030000000000000000000000000000000000000000000000000000000081529051606092600160a060020a0316916306fdde0391600480830192600092919082900301818387803b1580156104ff57600080fd5b505af1158015610513573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052602081101561053c57600080fd5b81019080805164010000000081111561055457600080fd5b8201602081018481111561056757600080fd5b815164010000000081118282018710171561058157600080fd5b509094505050505090565b6002546040805160e160020a635e33fc190281523360048201529051600092600160a060020a03169163bc67f832916024808301928692919082900301818387803b1580156105da57600080fd5b505af11580156105ee573d6000803e3d6000fd5b5050600254604080517f095ea7b3000000000000000000000000000000000000000000000000000000008152600160a060020a03888116600483015260248201889052915191909216935063095ea7b3925060448083019260209291908290030181600087803b15801561066157600080fd5b505af1158015610675573d6000803e3d6000fd5b505050506040513d602081101561068b57600080fd5b506001949350505050565b600054600160a060020a0316331461071e576040805160e560020a62461bcd02815260206004820152602f60248201527f4f6e6c792074686520636f6e7472616374206f776e6572206d6179207065726660448201527f6f726d207468697320616374696f6e0000000000000000000000000000000000606482015290519081900360840190fd5b60018054600160a060020a03831673ffffffffffffffffffffffffffffffffffffffff19909116811790915560408051918252517f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce229181900360200190a150565b600254604080517f18160ddd0000000000000000000000000000000000000000000000000000000081529051600092600160a060020a0316916318160ddd91600480830192602092919082900301818787803b1580156107de57600080fd5b505af11580156107f2573d6000803e3d6000fd5b505050506040513d602081101561080857600080fd5b5051905090565b6002546040805160e160020a635e33fc190281523360048201529051600092600160a060020a03169163bc67f832916024808301928692919082900301818387803b15801561085d57600080fd5b505af1158015610871573d6000803e3d6000fd5b5050600254604080517f23b872dd000000000000000000000000000000000000000000000000000000008152600160a060020a03898116600483015288811660248301526044820188905291519190921693506323b872dd925060648083019260209291908290030181600087803b1580156108ec57600080fd5b505af1158015610900573d6000803e3d6000fd5b505050506040513d602081101561091657600080fd5b50600195945050505050565b600254604080517f313ce5670000000000000000000000000000000000000000000000000000000081529051600092600160a060020a03169163313ce56791600480830192602092919082900301818787803b1580156107de57600080fd5b600154600160a060020a031681565b600254604080517f70a08231000000000000000000000000000000000000000000000000000000008152600160a060020a038481166004830152915160009392909216916370a082319160248082019260209290919082900301818787803b1580156109fb57600080fd5b505af1158015610a0f573d6000803e3d6000fd5b505050506040513d6020811015610a2557600080fd5b505192915050565b600054600160a060020a03163314610ab5576040805160e560020a62461bcd02815260206004820152602f60248201527f4f6e6c792074686520636f6e7472616374206f776e6572206d6179207065726660448201527f6f726d207468697320616374696f6e0000000000000000000000000000000000606482015290519081900360840190fd5b60028054600160a060020a03831673ffffffffffffffffffffffffffffffffffffffff19909116811790915560408051918252517f814250a3b8c79fcbe2ead2c131c952a278491c8f4322a79fe84b5040a810373e9181900360200190a150565b600154600160a060020a03163314610b9e576040805160e560020a62461bcd02815260206004820152603560248201527f596f75206d757374206265206e6f6d696e61746564206265666f726520796f7560448201527f2063616e20616363657074206f776e6572736869700000000000000000000000606482015290519081900360840190fd5b60005460015460408051600160a060020a03938416815292909116602083015280517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9281900390910190a1600180546000805473ffffffffffffffffffffffffffffffffffffffff19908116600160a060020a03841617909155169055565b600054600160a060020a031681565b600254600090606090600160a060020a03163314610c95576040805160e560020a62461bcd02815260206004820152601460248201527f4d7573742062652070726f787920746172676574000000000000000000000000604482015290519081900360640190fd5b604080516020601f8b01819004810282018101909252898152899350908a9084908190840183828082843782019150505050505090508660008114610cf95760018114610d045760028114610d105760038114610d1d5760048114610d2b57610d36565b8260208301a0610d36565b868360208401a1610d36565b85878460208501a2610d36565b8486888560208601a3610d36565b838587898660208701a45b50505050505050505050565b60025474010000000000000000000000000000000000000000900460ff1681565b600254604080517f95d89b410000000000000000000000000000000000000000000000000000000081529051606092600160a060020a0316916395d89b4191600480830192600092919082900301818387803b1580156104ff57600080fd5b6002546040805160e160020a635e33fc190281523360048201529051600092600160a060020a03169163bc67f832916024808301928692919082900301818387803b158015610e1057600080fd5b505af1158015610e24573d6000803e3d6000fd5b5050600254604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a03888116600483015260248201889052915191909216935063a9059cbb925060448083019260209291908290030181600087803b15801561066157600080fd5b600054600160a060020a03163314610f1f576040805160e560020a62461bcd02815260206004820152602f60248201527f4f6e6c792074686520636f6e7472616374206f776e6572206d6179207065726660448201527f6f726d207468697320616374696f6e0000000000000000000000000000000000606482015290519081900360840190fd5b60028054911515740100000000000000000000000000000000000000000274ff000000000000000000000000000000000000000019909216919091179055565b600254600160a060020a031681565b600254604080517fdd62ed3e000000000000000000000000000000000000000000000000000000008152600160a060020a03858116600483015284811660248301529151600093929092169163dd62ed3e9160448082019260209290919082900301818787803b158015610fe157600080fd5b505af1158015610ff5573d6000803e3d6000fd5b505050506040513d602081101561100b57600080fd5b505193925050505600a165627a7a723058208573241e5ee413058b913ac15b2eca07f8aab45ccb2ad4af9c8d12e04eb1329f0029
Verified Source Code Partial Match
Compiler: v0.4.25+commit.59dbf8f1
EVM: byzantium
Optimization: Yes (200 runs)
ProxyERC20.sol 389 lines
/*
Note:
This is a PROXY contract, it defers requests to its underlying TARGET contract.
Always use this address in your applications and never the TARGET as it is liable to change.
*//*
____ __ __ __ _
/ __/__ __ ___ / /_ / / ___ / /_ (_)__ __
_\ \ / // // _ \/ __// _ \/ -_)/ __// / \ \ /
/___/ \_, //_//_/\__//_//_/\__/ \__//_/ /_\_\
/___/
* Synthetix: ProxyERC20.sol
*
* Latest source (may be newer): https://github.com/Synthetixio/synthetix/blob/master/contracts/ProxyERC20.sol
* Docs: https://docs.synthetix.io/contracts/ProxyERC20
*
* Contract Dependencies:
* - IERC20
* - Owned
* - Proxy
* Libraries: (none)
*
* MIT License
* ===========
*
* Copyright (c) 2020 Synthetix
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
*/
/* ===============================================
* Flattened with Solidifier by Coinage
*
* https://solidifier.coina.ge
* ===============================================
*/
pragma solidity 0.4.25;
// https://docs.synthetix.io/contracts/Owned
contract Owned {
address public owner;
address public nominatedOwner;
/**
* @dev Owned Constructor
*/
constructor(address _owner) public {
require(_owner != address(0), "Owner address cannot be 0");
owner = _owner;
emit OwnerChanged(address(0), _owner);
}
/**
* @notice Nominate a new owner of this contract.
* @dev Only the current owner may nominate a new owner.
*/
function nominateNewOwner(address _owner) external onlyOwner {
nominatedOwner = _owner;
emit OwnerNominated(_owner);
}
/**
* @notice Accept the nomination to be owner.
*/
function acceptOwnership() external {
require(msg.sender == nominatedOwner, "You must be nominated before you can accept ownership");
emit OwnerChanged(owner, nominatedOwner);
owner = nominatedOwner;
nominatedOwner = address(0);
}
modifier onlyOwner {
require(msg.sender == owner, "Only the contract owner may perform this action");
_;
}
event OwnerNominated(address newOwner);
event OwnerChanged(address oldOwner, address newOwner);
}
// https://docs.synthetix.io/contracts/Proxy
contract Proxy is Owned {
Proxyable public target;
bool public useDELEGATECALL;
constructor(address _owner) public Owned(_owner) {}
function setTarget(Proxyable _target) external onlyOwner {
target = _target;
emit TargetUpdated(_target);
}
function setUseDELEGATECALL(bool value) external onlyOwner {
useDELEGATECALL = value;
}
function _emit(bytes callData, uint numTopics, bytes32 topic1, bytes32 topic2, bytes32 topic3, bytes32 topic4)
external
onlyTarget
{
uint size = callData.length;
bytes memory _callData = callData;
assembly {
/* The first 32 bytes of callData contain its length (as specified by the abi).
* Length is assumed to be a uint256 and therefore maximum of 32 bytes
* in length. It is also leftpadded to be a multiple of 32 bytes.
* This means moving call_data across 32 bytes guarantees we correctly access
* the data itself. */
switch numTopics
case 0 {
log0(add(_callData, 32), size)
}
case 1 {
log1(add(_callData, 32), size, topic1)
}
case 2 {
log2(add(_callData, 32), size, topic1, topic2)
}
case 3 {
log3(add(_callData, 32), size, topic1, topic2, topic3)
}
case 4 {
log4(add(_callData, 32), size, topic1, topic2, topic3, topic4)
}
}
}
function() external payable {
if (useDELEGATECALL) {
assembly {
/* Copy call data into free memory region. */
let free_ptr := mload(0x40)
calldatacopy(free_ptr, 0, calldatasize)
/* Forward all gas and call data to the target contract. */
let result := delegatecall(gas, sload(target_slot), free_ptr, calldatasize, 0, 0)
returndatacopy(free_ptr, 0, returndatasize)
/* Revert if the call failed, otherwise return the result. */
if iszero(result) {
revert(free_ptr, returndatasize)
}
return(free_ptr, returndatasize)
}
} else {
/* Here we are as above, but must send the messageSender explicitly
* since we are using CALL rather than DELEGATECALL. */
target.setMessageSender(msg.sender);
assembly {
let free_ptr := mload(0x40)
calldatacopy(free_ptr, 0, calldatasize)
/* We must explicitly forward ether to the underlying contract as well. */
let result := call(gas, sload(target_slot), callvalue, free_ptr, calldatasize, 0, 0)
returndatacopy(free_ptr, 0, returndatasize)
if iszero(result) {
revert(free_ptr, returndatasize)
}
return(free_ptr, returndatasize)
}
}
}
modifier onlyTarget {
require(Proxyable(msg.sender) == target, "Must be proxy target");
_;
}
event TargetUpdated(Proxyable newTarget);
}
// https://docs.synthetix.io/contracts/Proxyable
contract Proxyable is Owned {
// This contract should be treated like an abstract contract
/* The proxy this contract exists behind. */
Proxy public proxy;
Proxy public integrationProxy;
/* The caller of the proxy, passed through to this contract.
* Note that every function using this member must apply the onlyProxy or
* optionalProxy modifiers, otherwise their invocations can use stale values. */
address public messageSender;
constructor(address _proxy, address _owner) public Owned(_owner) {
proxy = Proxy(_proxy);
emit ProxyUpdated(_proxy);
}
function setProxy(address _proxy) external onlyOwner {
proxy = Proxy(_proxy);
emit ProxyUpdated(_proxy);
}
function setIntegrationProxy(address _integrationProxy) external onlyOwner {
integrationProxy = Proxy(_integrationProxy);
}
function setMessageSender(address sender) external onlyProxy {
messageSender = sender;
}
modifier onlyProxy {
require(Proxy(msg.sender) == proxy || Proxy(msg.sender) == integrationProxy, "Only the proxy can call");
_;
}
modifier optionalProxy {
if (Proxy(msg.sender) != proxy && Proxy(msg.sender) != integrationProxy && messageSender != msg.sender) {
messageSender = msg.sender;
}
_;
}
modifier optionalProxy_onlyOwner {
if (Proxy(msg.sender) != proxy && Proxy(msg.sender) != integrationProxy && messageSender != msg.sender) {
messageSender = msg.sender;
}
require(messageSender == owner, "Owner only function");
_;
}
event ProxyUpdated(address proxyAddress);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract IERC20 {
function totalSupply() public view returns (uint);
function balanceOf(address owner) public view returns (uint);
function allowance(address owner, address spender) public view returns (uint);
function transfer(address to, uint value) public returns (bool);
function approve(address spender, uint value) public returns (bool);
function transferFrom(address from, address to, uint value) public returns (bool);
// ERC20 Optional
function name() public view returns (string);
function symbol() public view returns (string);
function decimals() public view returns (uint8);
event Transfer(address indexed from, address indexed to, uint value);
event Approval(address indexed owner, address indexed spender, uint value);
}
// https://docs.synthetix.io/contracts/ProxyERC20
contract ProxyERC20 is Proxy, IERC20 {
constructor(address _owner) public Proxy(_owner) {}
// ------------- ERC20 Details ------------- //
function name() public view returns (string) {
// Immutable static call from target contract
return IERC20(target).name();
}
function symbol() public view returns (string) {
// Immutable static call from target contract
return IERC20(target).symbol();
}
function decimals() public view returns (uint8) {
// Immutable static call from target contract
return IERC20(target).decimals();
}
// ------------- ERC20 Interface ------------- //
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
// Immutable static call from target contract
return IERC20(target).totalSupply();
}
/**
* @dev Gets the balance of the specified address.
* @param account The address to query the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address account) public view returns (uint256) {
// Immutable static call from target contract
return IERC20(target).balanceOf(account);
}
/**
* @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) {
// Immutable static call from target contract
return IERC20(target).allowance(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) {
// Mutable state call requires the proxy to tell the target who the msg.sender is.
target.setMessageSender(msg.sender);
// Forward the ERC20 call to the target contract
IERC20(target).transfer(to, value);
// Event emitting will occur via Synthetix.Proxy._emit()
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) {
// Mutable state call requires the proxy to tell the target who the msg.sender is.
target.setMessageSender(msg.sender);
// Forward the ERC20 call to the target contract
IERC20(target).approve(spender, value);
// Event emitting will occur via Synthetix.Proxy._emit()
return true;
}
/**
* @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) {
// Mutable state call requires the proxy to tell the target who the msg.sender is.
target.setMessageSender(msg.sender);
// Forward the ERC20 call to the target contract
IERC20(target).transferFrom(from, to, value);
// Event emitting will occur via Synthetix.Proxy._emit()
return true;
}
}
Read Contract
allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
decimals 0x313ce567 → uint8
name 0x06fdde03 → string
nominatedOwner 0x53a47bb7 → address
owner 0x8da5cb5b → address
symbol 0x95d89b41 → string
target 0xd4b83992 → address
totalSupply 0x18160ddd → uint256
useDELEGATECALL 0x95578ebd → bool
Write Contract 8 functions
These functions modify contract state and require a wallet transaction to execute.
_emit 0x907dff97
bytes callData
uint256 numTopics
bytes32 topic1
bytes32 topic2
bytes32 topic3
bytes32 topic4
acceptOwnership 0x79ba5097
No parameters
approve 0x095ea7b3
address spender
uint256 value
returns: bool
nominateNewOwner 0x1627540c
address _owner
setTarget 0x776d1a01
address _target
setUseDELEGATECALL 0xbefff6af
bool value
transfer 0xa9059cbb
address to
uint256 value
returns: bool
transferFrom 0x23b872dd
address from
address to
uint256 value
returns: bool
Recent Transactions
No transactions found for this address