Feature Tip: Add private address tag to any address under My Name Tag !
Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 5 from a total of 5 transactions
Latest 1 internal transaction
Advanced mode:
Parent Transaction Hash | Block |
From
|
To
|
|||
---|---|---|---|---|---|---|
12161488 | 1391 days ago | Contract Creation | 0 ETH |
Loading...
Loading
Contract Name:
TokenTransferProxy
Compiler Version
v0.7.5+commit.eb77ed08
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2021-04-02 */ /** *Submitted for verification at Etherscan.io on 2021-04-02 */ // File: original_contracts/IWhitelisted.sol pragma solidity 0.7.5; interface IWhitelisted { function hasRole( bytes32 role, address account ) external view returns (bool); function WHITELISTED_ROLE() external view returns(bytes32); } // File: openzeppelin-solidity/contracts/token/ERC20/IERC20.sol pragma solidity >=0.6.0 <0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: 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 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } // File: original_contracts/lib/IExchange.sol pragma solidity 0.7.5; /** * @dev This interface should be implemented by all exchanges which needs to integrate with the paraswap protocol */ interface IExchange { /** * @dev The function which performs the swap on an exchange. * Exchange needs to implement this method in order to support swapping of tokens through it * @param fromToken Address of the source token * @param toToken Address of the destination token * @param fromAmount Amount of source tokens to be swapped * @param toAmount Minimum destination token amount expected out of this swap * @param exchange Internal exchange or factory contract address for the exchange. For example Registry address for the Uniswap * @param payload Any exchange specific data which is required can be passed in this argument in encoded format which * will be decoded by the exchange. Each exchange will publish it's own decoding/encoding mechanism */ //TODO: REMOVE RETURN STATEMENT function swap( IERC20 fromToken, IERC20 toToken, uint256 fromAmount, uint256 toAmount, address exchange, bytes calldata payload) external payable; /** * @dev The function which performs the swap on an exchange. * Exchange needs to implement this method in order to support swapping of tokens through it * @param fromToken Address of the source token * @param toToken Address of the destination token * @param fromAmount Max Amount of source tokens to be swapped * @param toAmount Destination token amount expected out of this swap * @param exchange Internal exchange or factory contract address for the exchange. For example Registry address for the Uniswap * @param payload Any exchange specific data which is required can be passed in this argument in encoded format which * will be decoded by the exchange. Each exchange will publish it's own decoding/encoding mechanism */ function buy( IERC20 fromToken, IERC20 toToken, uint256 fromAmount, uint256 toAmount, address exchange, bytes calldata payload) external payable; /** * @dev This function is used to perform onChainSwap. It build all the parameters onchain. Basically the information * encoded in payload param of swap will calculated in this case * Exchange needs to implement this method in order to support swapping of tokens through it * @param fromToken Address of the source token * @param toToken Address of the destination token * @param fromAmount Amount of source tokens to be swapped * @param toAmount Minimum destination token amount expected out of this swap */ function onChainSwap( IERC20 fromToken, IERC20 toToken, uint256 fromAmount, uint256 toAmount ) external payable returns (uint256); /** * @dev Certain adapters/exchanges needs to be initialized. * This method will be called from Augustus */ function initialize(bytes calldata data) external; /** * @dev Returns unique identifier for the adapter */ function getKey() external pure returns(bytes32); } // File: openzeppelin-solidity/contracts/math/SafeMath.sol pragma solidity >=0.6.0 <0.8.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot 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-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } // File: original_contracts/lib/SafeERC20.sol pragma solidity 0.7.5; library Address { function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: value }(data); return _verifyCallResult(success, returndata, errorMessage); } function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } library SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove(IERC20 token, address spender, uint256 value) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' // solhint-disable-next-line max-line-length require((value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).add(value); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } // File: original_contracts/ITokenTransferProxy.sol pragma solidity 0.7.5; interface ITokenTransferProxy { function transferFrom( address token, address from, address to, uint256 amount ) external; function freeReduxTokens(address user, uint256 tokensToFree) external; } // File: original_contracts/lib/Utils.sol pragma solidity 0.7.5; library Utils { using SafeMath for uint256; using SafeERC20 for IERC20; address constant ETH_ADDRESS = address( 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE ); address constant WETH_ADDRESS = address( 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 ); uint256 constant MAX_UINT = 2 ** 256 - 1; /** * @param fromToken Address of the source token * @param toToken Address of the destination token * @param fromAmount Amount of source tokens to be swapped * @param toAmount Minimum destination token amount expected out of this swap * @param expectedAmount Expected amount of destination tokens without slippage * @param beneficiary Beneficiary address * 0 then 100% will be transferred to beneficiary. Pass 10000 for 100% * @param referrer referral id * @param path Route to be taken for this swap to take place */ struct SellData { address fromToken; uint256 fromAmount; uint256 toAmount; uint256 expectedAmount; address payable beneficiary; string referrer; bool useReduxToken; Utils.Path[] path; } struct MegaSwapSellData { address fromToken; uint256 fromAmount; uint256 toAmount; uint256 expectedAmount; address payable beneficiary; string referrer; bool useReduxToken; Utils.MegaSwapPath[] path; } struct BuyData { address fromToken; address toToken; uint256 fromAmount; uint256 toAmount; address payable beneficiary; string referrer; bool useReduxToken; Utils.BuyRoute[] route; } struct Route { address payable exchange; address targetExchange; uint percent; bytes payload; uint256 networkFee;//Network fee is associated with 0xv3 trades } struct MegaSwapPath { uint256 fromAmountPercent; Path[] path; } struct Path { address to; uint256 totalNetworkFee;//Network fee is associated with 0xv3 trades Route[] routes; } struct BuyRoute { address payable exchange; address targetExchange; uint256 fromAmount; uint256 toAmount; bytes payload; uint256 networkFee;//Network fee is associated with 0xv3 trades } function ethAddress() internal pure returns (address) {return ETH_ADDRESS;} function wethAddress() internal pure returns (address) {return WETH_ADDRESS;} function maxUint() internal pure returns (uint256) {return MAX_UINT;} function approve( address addressToApprove, address token, uint256 amount ) internal { if (token != ETH_ADDRESS) { IERC20 _token = IERC20(token); uint allowance = _token.allowance(address(this), addressToApprove); if (allowance < amount) { _token.safeApprove(addressToApprove, 0); _token.safeIncreaseAllowance(addressToApprove, MAX_UINT); } } } function transferTokens( address token, address payable destination, uint256 amount ) internal { if (amount > 0) { if (token == ETH_ADDRESS) { (bool result, ) = destination.call{value: amount, gas: 4000}(""); require(result, "Failed to transfer Ether"); } else { IERC20(token).safeTransfer(destination, amount); } } } function tokenBalance( address token, address account ) internal view returns (uint256) { if (token == ETH_ADDRESS) { return account.balance; } else { return IERC20(token).balanceOf(account); } } /** * @dev Helper method to refund gas using gas tokens */ function refundGas( address account, address tokenTransferProxy, uint256 initialGas ) internal { uint256 freeBase = 14154; uint256 freeToken = 6870; uint256 reimburse = 24000; uint256 tokens = initialGas.sub( gasleft()).add(freeBase).div(reimburse.mul(2).sub(freeToken) ); freeGasTokens(account, tokenTransferProxy, tokens); } /** * @dev Helper method to free gas tokens */ function freeGasTokens(address account, address tokenTransferProxy, uint256 tokens) internal { uint256 tokensToFree = tokens; uint256 safeNumTokens = 0; uint256 gas = gasleft(); if (gas >= 27710) { safeNumTokens = gas.sub(27710).div(1148 + 5722 + 150); } if (tokensToFree > safeNumTokens) { tokensToFree = safeNumTokens; } ITokenTransferProxy(tokenTransferProxy).freeReduxTokens(account, tokensToFree); } } // File: openzeppelin-solidity/contracts/GSN/Context.sol pragma solidity >=0.6.0 <0.8.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with GSN meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } // File: openzeppelin-solidity/contracts/access/Ownable.sol pragma solidity >=0.6.0 <0.8.0; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } // File: original_contracts/IReduxToken.sol pragma solidity 0.7.5; interface IReduxToken { function freeUpTo(uint256 value) external returns (uint256 freed); function freeFromUpTo(address from, uint256 value) external returns (uint256 freed); function mint(uint256 value) external; } // File: original_contracts/TokenTransferProxy.sol pragma solidity 0.7.5; /** * @dev Allows owner of the contract to transfer tokens on behalf of user. * User will need to approve this contract to spend tokens on his/her behalf * on Paraswap platform */ contract TokenTransferProxy is Ownable, ITokenTransferProxy { using SafeERC20 for IERC20; IReduxToken public reduxToken; constructor(address _reduxToken) public { reduxToken = IReduxToken(_reduxToken); } /** * @dev Allows owner of the contract to transfer tokens on user's behalf * @dev Swapper contract will be the owner of this contract * @param token Address of the token * @param from Address from which tokens will be transferred * @param to Receipent address of the tokens * @param amount Amount of tokens to transfer */ function transferFrom( address token, address from, address to, uint256 amount ) external override onlyOwner { IERC20(token).safeTransferFrom(from, to, amount); } function freeReduxTokens(address user, uint256 tokensToFree) external override onlyOwner { reduxToken.freeFromUpTo(user, tokensToFree); } } // File: original_contracts/IPartnerRegistry.sol pragma solidity 0.7.5; interface IPartnerRegistry { function getPartnerContract(string calldata referralId) external view returns(address); } // File: original_contracts/IPartner.sol pragma solidity 0.7.5; interface IPartner { function getPartnerInfo() external view returns( address payable feeWallet, uint256 fee, uint256 partnerShare, uint256 paraswapShare, bool positiveSlippageToUser, bool noPositiveSlippage ); } // File: original_contracts/lib/TokenFetcherAugustus.sol pragma solidity 0.7.5; contract TokenFetcherAugustus { address internal _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(_owner == msg.sender, "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } /** * @dev Allows owner of the contract to transfer any tokens which are assigned to the contract * This method is for safety if by any chance tokens or ETHs are assigned to the contract by mistake * @dev token Address of the token to be transferred * @dev destination Recepient of the token * @dev amount Amount of tokens to be transferred */ function transferTokens( address token, address payable destination, uint256 amount ) external onlyOwner { Utils.transferTokens(token, destination, amount); } } // File: original_contracts/IWETH.sol pragma solidity 0.7.5; abstract contract IWETH is IERC20 { function deposit() external virtual payable; function withdraw(uint256 amount) external virtual; } // File: original_contracts/IUniswapProxy.sol pragma solidity 0.7.5; interface IUniswapProxy { function swapOnUniswap( uint256 amountIn, uint256 amountOutMin, address[] calldata path ) external returns (uint256); function swapOnUniswapFork( address factory, bytes32 initCode, uint256 amountIn, uint256 amountOutMin, address[] calldata path ) external returns (uint256); function buyOnUniswap( uint256 amountInMax, uint256 amountOut, address[] calldata path ) external returns (uint256 tokensSold); function buyOnUniswapFork( address factory, bytes32 initCode, uint256 amountInMax, uint256 amountOut, address[] calldata path ) external returns (uint256 tokensSold); function setupTokenSpender(address tokenSpender) external; } // File: original_contracts/AdapterStorage.sol pragma solidity 0.7.5; contract AdapterStorage { mapping (bytes32 => bool) internal adapterInitialized; mapping (bytes32 => bytes) internal adapterVsData; ITokenTransferProxy internal _tokenTransferProxy; function isInitialized(bytes32 key) public view returns(bool) { return adapterInitialized[key]; } function getData(bytes32 key) public view returns(bytes memory) { return adapterVsData[key]; } function getTokenTransferProxy() public view returns (address) { return address(_tokenTransferProxy); } } // File: original_contracts/AugustusSwapper.sol pragma solidity 0.7.5; pragma experimental ABIEncoderV2; contract AugustusSwapper is AdapterStorage, TokenFetcherAugustus { using SafeMath for uint256; IWhitelisted private _whitelisted; IPartnerRegistry private _partnerRegistry; address payable private _feeWallet; address private _uniswapProxy; address private _pendingUniswapProxy; uint256 private _changeRequestedBlock; //Number of blocks after which UniswapProxy change can be confirmed uint256 private _timelock; event Swapped( address initiator, address indexed beneficiary, address indexed srcToken, address indexed destToken, uint256 srcAmount, uint256 receivedAmount, uint256 expectedAmount, string referrer ); event Bought( address initiator, address indexed beneficiary, address indexed srcToken, address indexed destToken, uint256 srcAmount, uint256 receivedAmount, string referrer ); event FeeTaken( uint256 fee, uint256 partnerShare, uint256 paraswapShare ); event AdapterInitialized(address indexed adapter); modifier onlySelf() { require( msg.sender == address(this), "AugustusSwapper: Invalid access" ); _; } receive () payable external { } function getTimeLock() external view returns(uint256) { return _timelock; } function initialize( address whitelist, address reduxToken, address partnerRegistry, address payable feeWallet, address uniswapProxy, uint256 timelock ) external { require(address(_tokenTransferProxy) == address(0), "Contract already initialized!!"); _partnerRegistry = IPartnerRegistry(partnerRegistry); TokenTransferProxy lTokenTransferProxy = new TokenTransferProxy(reduxToken); _tokenTransferProxy = ITokenTransferProxy(lTokenTransferProxy); _whitelisted = IWhitelisted(whitelist); _feeWallet = feeWallet; _uniswapProxy = uniswapProxy; _owner = msg.sender; _timelock = timelock; } function initializeAdapter(address adapter, bytes calldata data) external onlyOwner { require( _whitelisted.hasRole(_whitelisted.WHITELISTED_ROLE(), adapter), "Exchange not whitelisted" ); (bool success,) = adapter.delegatecall(abi.encodeWithSelector(IExchange.initialize.selector, data)); require(success, "Failed to initialize adapter"); emit AdapterInitialized(adapter); } function getPendingUniswapProxy() external view returns(address) { return _pendingUniswapProxy; } function getChangeRequestedBlock() external view returns(uint256) { return _changeRequestedBlock; } function getUniswapProxy() external view returns(address) { return _uniswapProxy; } function getVersion() external view returns(string memory) { return "4.0.0"; } function getPartnerRegistry() external view returns(address) { return address(_partnerRegistry); } function getWhitelistAddress() external view returns(address) { return address(_whitelisted); } function getFeeWallet() external view returns(address) { return _feeWallet; } function changeUniswapProxy(address uniswapProxy) external onlyOwner { require(uniswapProxy != address(0), "Invalid address"); _changeRequestedBlock = block.number; _pendingUniswapProxy = uniswapProxy; } function confirmUniswapProxyChange() external onlyOwner { require( block.number >= _changeRequestedBlock.add(_timelock), "Time lock check failed" ); require(_pendingUniswapProxy != address(0), "No pending request"); _changeRequestedBlock = 0; _uniswapProxy = _pendingUniswapProxy; _pendingUniswapProxy = address(0); } function setFeeWallet(address payable feeWallet) external onlyOwner { require(feeWallet != address(0), "Invalid address"); _feeWallet = feeWallet; } function setPartnerRegistry(address partnerRegistry) external onlyOwner { require(partnerRegistry != address(0), "Invalid address"); _partnerRegistry = IPartnerRegistry(partnerRegistry); } function setWhitelistAddress(address whitelisted) external onlyOwner { require(whitelisted != address(0), "Invalid whitelist address"); _whitelisted = IWhitelisted(whitelisted); } function swapOnUniswap( uint256 amountIn, uint256 amountOutMin, address[] calldata path, uint8 referrer ) external payable { //DELEGATING CALL TO THE ADAPTER (bool success, bytes memory result) = _uniswapProxy.delegatecall( abi.encodeWithSelector( IUniswapProxy.swapOnUniswap.selector, amountIn, amountOutMin, path ) ); require(success, "Call to uniswap proxy failed"); } function buyOnUniswap( uint256 amountInMax, uint256 amountOut, address[] calldata path, uint8 referrer ) external payable { //DELEGATING CALL TO THE ADAPTER (bool success, bytes memory result) = _uniswapProxy.delegatecall( abi.encodeWithSelector( IUniswapProxy.buyOnUniswap.selector, amountInMax, amountOut, path ) ); require(success, "Call to uniswap proxy failed"); } function buyOnUniswapFork( address factory, bytes32 initCode, uint256 amountInMax, uint256 amountOut, address[] calldata path, uint8 referrer ) external payable { //DELEGATING CALL TO THE ADAPTER (bool success, bytes memory result) = _uniswapProxy.delegatecall( abi.encodeWithSelector( IUniswapProxy.buyOnUniswapFork.selector, factory, initCode, amountInMax, amountOut, path ) ); require(success, "Call to uniswap proxy failed"); } function swapOnUniswapFork( address factory, bytes32 initCode, uint256 amountIn, uint256 amountOutMin, address[] calldata path, uint8 referrer ) external payable { //DELEGATING CALL TO THE ADAPTER (bool success, bytes memory result) = _uniswapProxy.delegatecall( abi.encodeWithSelector( IUniswapProxy.swapOnUniswapFork.selector, factory, initCode, amountIn, amountOutMin, path ) ); require(success, "Call to uniswap proxy failed"); } function simplBuy( address fromToken, address toToken, uint256 fromAmount, uint256 toAmount, address[] memory callees, bytes memory exchangeData, uint256[] memory startIndexes, uint256[] memory values, address payable beneficiary, string memory referrer, bool useReduxToken ) external payable { beneficiary = beneficiary == address(0) ? msg.sender : beneficiary; uint receivedAmount = performSimpleSwap( fromToken, toToken, fromAmount, toAmount, toAmount,//expected amount and to amount are same in case of buy callees, exchangeData, startIndexes, values, beneficiary, referrer, useReduxToken ); uint256 remainingAmount = Utils.tokenBalance( fromToken, address(this) ); if (remainingAmount > 0) { Utils.transferTokens(address(fromToken), msg.sender, remainingAmount); } emit Bought( msg.sender, beneficiary, fromToken, toToken, fromAmount, receivedAmount, referrer ); } function approve( address token, address to, uint256 amount ) external onlySelf { Utils.approve(to, token, amount); } function simpleSwap( address fromToken, address toToken, uint256 fromAmount, uint256 toAmount, uint256 expectedAmount, address[] memory callees, bytes memory exchangeData, uint256[] memory startIndexes, uint256[] memory values, address payable beneficiary, string memory referrer, bool useReduxToken ) public payable returns (uint256 receivedAmount) { beneficiary = beneficiary == address(0) ? msg.sender : beneficiary; receivedAmount = performSimpleSwap( fromToken, toToken, fromAmount, toAmount, expectedAmount, callees, exchangeData, startIndexes, values, beneficiary, referrer, useReduxToken ); emit Swapped( msg.sender, beneficiary, fromToken, toToken, fromAmount, receivedAmount, expectedAmount, referrer ); return receivedAmount; } function transferTokensFromProxy( address token, uint256 amount ) private { if (token != Utils.ethAddress()) { _tokenTransferProxy.transferFrom( token, msg.sender, address(this), amount ); } } function performSimpleSwap( address fromToken, address toToken, uint256 fromAmount, uint256 toAmount, uint256 expectedAmount, address[] memory callees, bytes memory exchangeData, uint256[] memory startIndexes, uint256[] memory values, address payable beneficiary, string memory referrer, bool useReduxToken ) private returns (uint256 receivedAmount) { require(toAmount > 0, "toAmount is too low"); require( callees.length + 1 == startIndexes.length, "Start indexes must be 1 greater then number of callees" ); uint initialGas = gasleft(); //If source token is not ETH than transfer required amount of tokens //from sender to this contract transferTokensFromProxy(fromToken, fromAmount); for (uint256 i = 0; i < callees.length; i++) { require( callees[i] != address(_tokenTransferProxy), "Can not call TokenTransferProxy Contract" ); bool result = externalCall( callees[i], //destination values[i], //value to send startIndexes[i], // start index of call data startIndexes[i + 1].sub(startIndexes[i]), // length of calldata exchangeData// total calldata ); require(result, "External call failed"); } receivedAmount = Utils.tokenBalance( toToken, address(this) ); require( receivedAmount >= toAmount, "Received amount of tokens are less then expected" ); takeFeeAndTransferTokens( toToken, expectedAmount, receivedAmount, beneficiary, referrer ); if (useReduxToken) { Utils.refundGas(msg.sender, address(_tokenTransferProxy), initialGas); } return receivedAmount; } /** * @dev This function sends the WETH returned during the exchange to the user. * @param token: The WETH Address */ function withdrawAllWETH(IWETH token) external onlySelf { uint256 amount = token.balanceOf(address(this)); token.withdraw(amount); } /** * @dev The function which performs the multi path swap. * @param data Data required to perform swap. */ function multiSwap( Utils.SellData memory data ) public payable returns (uint256) { uint initialGas = gasleft(); address fromToken = data.fromToken; uint256 fromAmount = data.fromAmount; uint256 toAmount = data.toAmount; uint256 expectedAmount = data.expectedAmount; address payable beneficiary = data.beneficiary == address(0) ? msg.sender : data.beneficiary; string memory referrer = data.referrer; Utils.Path[] memory path = data.path; address toToken = path[path.length - 1].to; bool useReduxToken = data.useReduxToken; //Referral can never be empty require(bytes(referrer).length > 0, "Invalid referrer"); require(toAmount > 0, "To amount can not be 0"); //if fromToken is not ETH then transfer tokens from user to this contract if (fromToken != Utils.ethAddress()) { _tokenTransferProxy.transferFrom( fromToken, msg.sender, address(this), fromAmount ); } performSwap( fromToken, fromAmount, path ); uint256 receivedAmount = Utils.tokenBalance( toToken, address(this) ); require( receivedAmount >= toAmount, "Received amount of tokens are less then expected" ); takeFeeAndTransferTokens( toToken, expectedAmount, receivedAmount, beneficiary, referrer ); if (useReduxToken) { Utils.refundGas(msg.sender, address(_tokenTransferProxy), initialGas); } emit Swapped( msg.sender, beneficiary, fromToken, toToken, fromAmount, receivedAmount, expectedAmount, referrer ); return receivedAmount; } /** * @dev The function which performs the mega path swap. * @param data Data required to perform swap. */ function megaSwap( Utils.MegaSwapSellData memory data ) public payable returns (uint256) { uint initialGas = gasleft(); address fromToken = data.fromToken; uint256 fromAmount = data.fromAmount; uint256 toAmount = data.toAmount; uint256 expectedAmount = data.expectedAmount; address payable beneficiary = data.beneficiary == address(0) ? msg.sender : data.beneficiary; string memory referrer = data.referrer; Utils.MegaSwapPath[] memory path = data.path; address toToken = path[0].path[path[0].path.length - 1].to; bool useReduxToken = data.useReduxToken; //Referral can never be empty require(bytes(referrer).length > 0, "Invalid referrer"); require(toAmount > 0, "To amount can not be 0"); //if fromToken is not ETH then transfer tokens from user to this contract if (fromToken != Utils.ethAddress()) { _tokenTransferProxy.transferFrom( fromToken, msg.sender, address(this), fromAmount ); } for (uint8 i = 0; i < uint8(path.length); i++) { uint256 _fromAmount = fromAmount.mul(path[i].fromAmountPercent).div(10000); if (i == path.length - 1) { _fromAmount = Utils.tokenBalance(address(fromToken), address(this)); } performSwap( fromToken, _fromAmount, path[i].path ); } uint256 receivedAmount = Utils.tokenBalance( toToken, address(this) ); require( receivedAmount >= toAmount, "Received amount of tokens are less then expected" ); takeFeeAndTransferTokens( toToken, expectedAmount, receivedAmount, beneficiary, referrer ); if (useReduxToken) { Utils.refundGas(msg.sender, address(_tokenTransferProxy), initialGas); } emit Swapped( msg.sender, beneficiary, fromToken, toToken, fromAmount, receivedAmount, expectedAmount, referrer ); return receivedAmount; } /** * @dev The function which performs the single path buy. * @param data Data required to perform swap. */ function buy( Utils.BuyData memory data ) public payable returns (uint256) { address fromToken = data.fromToken; uint256 fromAmount = data.fromAmount; uint256 toAmount = data.toAmount; address payable beneficiary = data.beneficiary == address(0) ? msg.sender : data.beneficiary; string memory referrer = data.referrer; Utils.BuyRoute[] memory route = data.route; address toToken = data.toToken; bool useReduxToken = data.useReduxToken; //Referral id can never be empty require(bytes(referrer).length > 0, "Invalid referrer"); require(toAmount > 0, "To amount can not be 0"); uint256 receivedAmount = performBuy( fromToken, toToken, fromAmount, toAmount, route, useReduxToken ); takeFeeAndTransferTokens( toToken, toAmount, receivedAmount, beneficiary, referrer ); uint256 remainingAmount = Utils.tokenBalance( fromToken, address(this) ); if (remainingAmount > 0) { Utils.transferTokens(fromToken, msg.sender, remainingAmount); } emit Bought( msg.sender, beneficiary, fromToken, toToken, fromAmount, receivedAmount, referrer ); return receivedAmount; } //Helper function to transfer final amount to the beneficiaries function takeFeeAndTransferTokens( address toToken, uint256 expectedAmount, uint256 receivedAmount, address payable beneficiary, string memory referrer ) private { uint256 remainingAmount = receivedAmount; address partnerContract = _partnerRegistry.getPartnerContract(referrer); //Take partner fee ( uint256 fee ) = _takeFee( toToken, receivedAmount, expectedAmount, partnerContract ); remainingAmount = receivedAmount.sub(fee); //If there is a positive slippage after taking partner fee then 50% goes to paraswap and 50% to the user if ((remainingAmount > expectedAmount) && fee == 0) { uint256 positiveSlippageShare = remainingAmount.sub(expectedAmount).div(2); remainingAmount = remainingAmount.sub(positiveSlippageShare); Utils.transferTokens(toToken, _feeWallet, positiveSlippageShare); } Utils.transferTokens(toToken, beneficiary, remainingAmount); } /** * @dev Source take from GNOSIS MultiSigWallet * @dev https://github.com/gnosis/MultiSigWallet/blob/master/contracts/MultiSigWallet.sol */ function externalCall( address destination, uint256 value, uint256 dataOffset, uint dataLength, bytes memory data ) private returns (bool) { bool result = false; assembly { let x := mload(0x40) // "Allocate" memory for output (0x40 is where "free memory" pointer is stored by convention) let d := add(data, 32) // First 32 bytes are the padded length of data, so exclude that result := call( sub(gas(), 34710), // 34710 is the value that solidity is currently emitting // It includes callGas (700) + callVeryLow (3, to pay for SUB) + callValueTransferGas (9000) + // callNewAccountGas (25000, in case the destination address does not exist and needs creating) destination, value, add(d, dataOffset), dataLength, // Size of the input (in bytes) - this is what fixes the padding problem x, 0 // Output is ignored, therefore the output size is zero ) } return result; } //Helper function to perform swap function performSwap( address fromToken, uint256 fromAmount, Utils.Path[] memory path ) private { require(path.length > 0, "Path not provided for swap"); //Assuming path will not be too long to reach out of gas exception for (uint i = 0; i < path.length; i++) { //_fromToken will be either fromToken or toToken of the previous path address _fromToken = i > 0 ? path[i - 1].to : fromToken; address _toToken = path[i].to; uint256 _fromAmount = i > 0 ? Utils.tokenBalance(_fromToken, address(this)) : fromAmount; if (i > 0 && _fromToken == Utils.ethAddress()) { _fromAmount = _fromAmount.sub(path[i].totalNetworkFee); } for (uint j = 0; j < path[i].routes.length; j++) { Utils.Route memory route = path[i].routes[j]; //Check if exchange is supported require( _whitelisted.hasRole(_whitelisted.WHITELISTED_ROLE(), route.exchange), "Exchange not whitelisted" ); //Calculating tokens to be passed to the relevant exchange //percentage should be 200 for 2% uint fromAmountSlice = _fromAmount.mul(route.percent).div(10000); uint256 value = route.networkFee; if (i > 0 && j == path[i].routes.length.sub(1)) { uint256 remBal = Utils.tokenBalance(address(_fromToken), address(this)); fromAmountSlice = remBal; if (address(_fromToken) == Utils.ethAddress()) { //subtract network fee fromAmountSlice = fromAmountSlice.sub(value); } } //DELEGATING CALL TO THE ADAPTER (bool success,) = route.exchange.delegatecall( abi.encodeWithSelector( IExchange.swap.selector, _fromToken, _toToken, fromAmountSlice, 1, route.targetExchange, route.payload ) ); require(success, "Call to adapter failed"); } } } //Helper function to perform swap function performBuy( address fromToken, address toToken, uint256 fromAmount, uint256 toAmount, Utils.BuyRoute[] memory routes, bool useReduxToken ) private returns(uint256) { uint initialGas = gasleft(); //if fromToken is not ETH then transfer tokens from user to this contract if (fromToken != Utils.ethAddress()) { _tokenTransferProxy.transferFrom( fromToken, msg.sender, address(this), fromAmount ); } for (uint j = 0; j < routes.length; j++) { Utils.BuyRoute memory route = routes[j]; //Check if exchange is supported require( _whitelisted.hasRole(_whitelisted.WHITELISTED_ROLE(), route.exchange), "Exchange not whitelisted" ); //delegate Call to the exchange (bool success,) = route.exchange.delegatecall( abi.encodeWithSelector( IExchange.buy.selector, fromToken, toToken, route.fromAmount, route.toAmount, route.targetExchange, route.payload ) ); require(success, "Call to adapter failed"); } uint256 receivedAmount = Utils.tokenBalance( toToken, address(this) ); require( receivedAmount >= toAmount, "Received amount of tokens are less then expected tokens" ); if (useReduxToken) { Utils.refundGas(msg.sender, address(_tokenTransferProxy), initialGas); } return receivedAmount; } function _takeFee( address toToken, uint256 receivedAmount, uint256 expectedAmount, address partnerContract ) private returns(uint256 fee) { //If there is no partner associated with the referral id then no fee will be taken if (partnerContract == address(0)) { return (0); } ( address payable partnerFeeWallet, uint256 feePercent, uint256 partnerSharePercent, , bool positiveSlippageToUser, bool noPositiveSlippage ) = IPartner(partnerContract).getPartnerInfo(); uint256 partnerShare = 0; uint256 paraswapShare = 0; if (!noPositiveSlippage && feePercent <= 50 && receivedAmount > expectedAmount) { uint256 halfPositiveSlippage = receivedAmount.sub(expectedAmount).div(2); //Calculate total fee to be taken fee = expectedAmount.mul(feePercent).div(10000); //Calculate partner's share partnerShare = fee.mul(partnerSharePercent).div(10000); //All remaining fee is paraswap's share paraswapShare = fee.sub(partnerShare); paraswapShare = paraswapShare.add(halfPositiveSlippage); fee = fee.add(halfPositiveSlippage); if (!positiveSlippageToUser) { partnerShare = partnerShare.add(halfPositiveSlippage); fee = fee.add(halfPositiveSlippage); } } else { //Calculate total fee to be taken fee = receivedAmount.mul(feePercent).div(10000); //Calculate partner's share partnerShare = fee.mul(partnerSharePercent).div(10000); //All remaining fee is paraswap's share paraswapShare = fee.sub(partnerShare); } Utils.transferTokens(toToken, partnerFeeWallet, partnerShare); Utils.transferTokens(toToken, _feeWallet, paraswapShare); emit FeeTaken(fee, partnerShare, paraswapShare); return (fee); } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_reduxToken","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"tokensToFree","type":"uint256"}],"name":"freeReduxTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"reduxToken","outputs":[{"internalType":"contract IReduxToken","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b50604051610c1d380380610c1d83398101604081905261002f916100ac565b60006100396100a8565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a350600180546001600160a01b0319166001600160a01b03929092169190911790556100da565b3390565b6000602082840312156100bd578081fd5b81516001600160a01b03811681146100d3578182fd5b9392505050565b610b34806100e96000396000f3fe608060405234801561001057600080fd5b50600436106100725760003560e01c80638da5cb5b116100505780638da5cb5b146100b2578063dd1fe62c146100ba578063f2fde38b146100cd57610072565b806315dacbea14610077578063715018a61461008c5780637fb9312714610094575b600080fd5b61008a6100853660046107bf565b6100e0565b005b61008a61016d565b61009c610238565b6040516100a99190610886565b60405180910390f35b61009c610254565b61008a6100c8366004610809565b610270565b61008a6100db3660046107a5565b61037b565b6100e86104b1565b60005473ffffffffffffffffffffffffffffffffffffffff908116911614610145576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161013c90610a09565b60405180910390fd5b61016773ffffffffffffffffffffffffffffffffffffffff85168484846104b5565b50505050565b6101756104b1565b60005473ffffffffffffffffffffffffffffffffffffffff9081169116146101c9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161013c90610a09565b6000805460405173ffffffffffffffffffffffffffffffffffffffff909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b60015473ffffffffffffffffffffffffffffffffffffffff1681565b60005473ffffffffffffffffffffffffffffffffffffffff1690565b6102786104b1565b60005473ffffffffffffffffffffffffffffffffffffffff9081169116146102cc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161013c90610a09565b6001546040517f079d229f00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091169063079d229f9061032490859085906004016108d8565b602060405180830381600087803b15801561033e57600080fd5b505af1158015610352573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103769190610852565b505050565b6103836104b1565b60005473ffffffffffffffffffffffffffffffffffffffff9081169116146103d7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161013c90610a09565b73ffffffffffffffffffffffffffffffffffffffff8116610424576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161013c9061094f565b6000805460405173ffffffffffffffffffffffffffffffffffffffff808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b3390565b610167846323b872dd60e01b8585856040516024016104d6939291906108a7565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009093169290921790915260606105b5826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166106099092919063ffffffff16565b80519091501561037657808060200190518101906105d39190610832565b610376576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161013c90610a75565b60606106188484600085610622565b90505b9392505050565b60608247101561065e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161013c906109ac565b61066785610724565b61069d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161013c90610a3e565b600060608673ffffffffffffffffffffffffffffffffffffffff1685876040516106c7919061086a565b60006040518083038185875af1925050503d8060008114610704576040519150601f19603f3d011682016040523d82523d6000602084013e610709565b606091505b509150915061071982828661072e565b979650505050505050565b803b15155b919050565b6060831561073d57508161061b565b82511561074d5782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161013c91906108fe565b803573ffffffffffffffffffffffffffffffffffffffff8116811461072957600080fd5b6000602082840312156107b6578081fd5b61061b82610781565b600080600080608085870312156107d4578283fd5b6107dd85610781565b93506107eb60208601610781565b92506107f960408601610781565b9396929550929360600135925050565b6000806040838503121561081b578182fd5b61082483610781565b946020939093013593505050565b600060208284031215610843578081fd5b8151801515811461061b578182fd5b600060208284031215610863578081fd5b5051919050565b6000825161087c818460208701610ad2565b9190910192915050565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b73ffffffffffffffffffffffffffffffffffffffff9384168152919092166020820152604081019190915260600190565b73ffffffffffffffffffffffffffffffffffffffff929092168252602082015260400190565b600060208252825180602084015261091d816040850160208701610ad2565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201527f6464726573730000000000000000000000000000000000000000000000000000606082015260800190565b60208082526026908201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60408201527f722063616c6c0000000000000000000000000000000000000000000000000000606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252601d908201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604082015260600190565b6020808252602a908201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60408201527f6f74207375636365656400000000000000000000000000000000000000000000606082015260800190565b60005b83811015610aed578181015183820152602001610ad5565b83811115610167575050600091015256fea2646970667358221220ab62661474abad01a8ead0fb0a1c72f0b0032e0f272241e9e47d63d3fc96b43164736f6c63430007050033000000000000000000000000000000000000cb2d80a37898be43579c7b616844
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100725760003560e01c80638da5cb5b116100505780638da5cb5b146100b2578063dd1fe62c146100ba578063f2fde38b146100cd57610072565b806315dacbea14610077578063715018a61461008c5780637fb9312714610094575b600080fd5b61008a6100853660046107bf565b6100e0565b005b61008a61016d565b61009c610238565b6040516100a99190610886565b60405180910390f35b61009c610254565b61008a6100c8366004610809565b610270565b61008a6100db3660046107a5565b61037b565b6100e86104b1565b60005473ffffffffffffffffffffffffffffffffffffffff908116911614610145576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161013c90610a09565b60405180910390fd5b61016773ffffffffffffffffffffffffffffffffffffffff85168484846104b5565b50505050565b6101756104b1565b60005473ffffffffffffffffffffffffffffffffffffffff9081169116146101c9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161013c90610a09565b6000805460405173ffffffffffffffffffffffffffffffffffffffff909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b60015473ffffffffffffffffffffffffffffffffffffffff1681565b60005473ffffffffffffffffffffffffffffffffffffffff1690565b6102786104b1565b60005473ffffffffffffffffffffffffffffffffffffffff9081169116146102cc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161013c90610a09565b6001546040517f079d229f00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091169063079d229f9061032490859085906004016108d8565b602060405180830381600087803b15801561033e57600080fd5b505af1158015610352573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103769190610852565b505050565b6103836104b1565b60005473ffffffffffffffffffffffffffffffffffffffff9081169116146103d7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161013c90610a09565b73ffffffffffffffffffffffffffffffffffffffff8116610424576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161013c9061094f565b6000805460405173ffffffffffffffffffffffffffffffffffffffff808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b3390565b610167846323b872dd60e01b8585856040516024016104d6939291906108a7565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009093169290921790915260606105b5826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166106099092919063ffffffff16565b80519091501561037657808060200190518101906105d39190610832565b610376576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161013c90610a75565b60606106188484600085610622565b90505b9392505050565b60608247101561065e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161013c906109ac565b61066785610724565b61069d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161013c90610a3e565b600060608673ffffffffffffffffffffffffffffffffffffffff1685876040516106c7919061086a565b60006040518083038185875af1925050503d8060008114610704576040519150601f19603f3d011682016040523d82523d6000602084013e610709565b606091505b509150915061071982828661072e565b979650505050505050565b803b15155b919050565b6060831561073d57508161061b565b82511561074d5782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161013c91906108fe565b803573ffffffffffffffffffffffffffffffffffffffff8116811461072957600080fd5b6000602082840312156107b6578081fd5b61061b82610781565b600080600080608085870312156107d4578283fd5b6107dd85610781565b93506107eb60208601610781565b92506107f960408601610781565b9396929550929360600135925050565b6000806040838503121561081b578182fd5b61082483610781565b946020939093013593505050565b600060208284031215610843578081fd5b8151801515811461061b578182fd5b600060208284031215610863578081fd5b5051919050565b6000825161087c818460208701610ad2565b9190910192915050565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b73ffffffffffffffffffffffffffffffffffffffff9384168152919092166020820152604081019190915260600190565b73ffffffffffffffffffffffffffffffffffffffff929092168252602082015260400190565b600060208252825180602084015261091d816040850160208701610ad2565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201527f6464726573730000000000000000000000000000000000000000000000000000606082015260800190565b60208082526026908201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60408201527f722063616c6c0000000000000000000000000000000000000000000000000000606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252601d908201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604082015260600190565b6020808252602a908201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60408201527f6f74207375636365656400000000000000000000000000000000000000000000606082015260800190565b60005b83811015610aed578181015183820152602001610ad5565b83811115610167575050600091015256fea2646970667358221220ab62661474abad01a8ead0fb0a1c72f0b0032e0f272241e9e47d63d3fc96b43164736f6c63430007050033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000000000000000cb2d80a37898be43579c7b616844
-----Decoded View---------------
Arg [0] : _reduxToken (address): 0x000000000000CB2D80A37898be43579C7b616844
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000000000000000cb2d80a37898be43579c7b616844
Deployed Bytecode Sourcemap
26175:1020:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;26782:249;;;;;;:::i;:::-;;:::i;:::-;;25029:148;;;:::i;26277:29::-;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;24387:79;;;:::i;27039:151::-;;;;;;:::i;:::-;;:::i;25332:244::-;;;;;;:::i;:::-;;:::i;26782:249::-;24609:12;:10;:12::i;:::-;24599:6;;:22;:6;;;:22;;;24591:67;;;;;;;;;;;;:::i;:::-;;;;;;;;;26975:48:::1;:30;::::0;::::1;27006:4:::0;27012:2;27016:6;26975:30:::1;:48::i;:::-;26782:249:::0;;;;:::o;25029:148::-;24609:12;:10;:12::i;:::-;24599:6;;:22;:6;;;:22;;;24591:67;;;;;;;;;;;;:::i;:::-;25136:1:::1;25120:6:::0;;25099:40:::1;::::0;::::1;25120:6:::0;;::::1;::::0;25099:40:::1;::::0;25136:1;;25099:40:::1;25167:1;25150:19:::0;;;::::1;::::0;;25029:148::o;26277:29::-;;;;;;:::o;24387:79::-;24425:7;24452:6;;;24387:79;:::o;27039:151::-;24609:12;:10;:12::i;:::-;24599:6;;:22;:6;;;:22;;;24591:67;;;;;;;;;;;;:::i;:::-;27139:10:::1;::::0;:43:::1;::::0;;;;:10:::1;::::0;;::::1;::::0;:23:::1;::::0;:43:::1;::::0;27163:4;;27169:12;;27139:43:::1;;;:::i;:::-;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;27039:151:::0;;:::o;25332:244::-;24609:12;:10;:12::i;:::-;24599:6;;:22;:6;;;:22;;;24591:67;;;;;;;;;;;;:::i;:::-;25421:22:::1;::::0;::::1;25413:73;;;;;;;;;;;;:::i;:::-;25523:6;::::0;;25502:38:::1;::::0;::::1;::::0;;::::1;::::0;25523:6;::::1;::::0;25502:38:::1;::::0;::::1;25551:6;:17:::0;;;::::1;;::::0;;;::::1;::::0;;;::::1;::::0;;25332:244::o;22914:106::-;23002:10;22914:106;:::o;14182:205::-;14283:96;14303:5;14333:27;;;14362:4;14368:2;14372:5;14310:68;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;16387:23;16413:69;16441:4;16413:69;;;;;;;;;;;;;;;;;16421:5;16413:27;;;;:69;;;;;:::i;:::-;16497:17;;16387:95;;-1:-1:-1;16497:21:0;16493:224;;16639:10;16628:30;;;;;;;;;;;;:::i;:::-;16620:85;;;;;;;;;;;;:::i;12413:195::-;12516:12;12548:52;12570:6;12578:4;12584:1;12587:12;12548:21;:52::i;:::-;12541:59;;12413:195;;;;;;:::o;12616:530::-;12743:12;12801:5;12776:21;:30;;12768:81;;;;;;;;;;;;:::i;:::-;12868:18;12879:6;12868:10;:18::i;:::-;12860:60;;;;;;;;;;;;:::i;:::-;12994:12;13008:23;13035:6;:11;;13055:5;13063:4;13035:33;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;12993:75;;;;13086:52;13104:7;13113:10;13125:12;13086:17;:52::i;:::-;13079:59;12616:530;-1:-1:-1;;;;;;;12616:530:0:o;11983:422::-;12350:20;;12389:8;;11983:422;;;;:::o;13154:742::-;13269:12;13298:7;13294:595;;;-1:-1:-1;13329:10:0;13322:17;;13294:595;13443:17;;:21;13439:439;;13706:10;13700:17;13767:15;13754:10;13750:2;13746:19;13739:44;13654:148;13849:12;13842:20;;;;;;;;;;;:::i;14:198:1:-;84:20;;144:42;133:54;;123:65;;113:2;;202:1;199;192:12;217:198;;329:2;317:9;308:7;304:23;300:32;297:2;;;350:6;342;335:22;297:2;378:31;399:9;378:31;:::i;420:419::-;;;;;583:3;571:9;562:7;558:23;554:33;551:2;;;605:6;597;590:22;551:2;633:31;654:9;633:31;:::i;:::-;623:41;;683:40;719:2;708:9;704:18;683:40;:::i;:::-;673:50;;742:40;778:2;767:9;763:18;742:40;:::i;:::-;541:298;;;;-1:-1:-1;732:50:1;;829:2;814:18;801:32;;-1:-1:-1;;541:298:1:o;844:266::-;;;973:2;961:9;952:7;948:23;944:32;941:2;;;994:6;986;979:22;941:2;1022:31;1043:9;1022:31;:::i;:::-;1012:41;1100:2;1085:18;;;;1072:32;;-1:-1:-1;;;931:179:1:o;1115:297::-;;1235:2;1223:9;1214:7;1210:23;1206:32;1203:2;;;1256:6;1248;1241:22;1203:2;1293:9;1287:16;1346:5;1339:13;1332:21;1325:5;1322:32;1312:2;;1373:6;1365;1358:22;1417:194;;1540:2;1528:9;1519:7;1515:23;1511:32;1508:2;;;1561:6;1553;1546:22;1508:2;-1:-1:-1;1589:16:1;;1498:113;-1:-1:-1;1498:113:1:o;1616:274::-;;1783:6;1777:13;1799:53;1845:6;1840:3;1833:4;1825:6;1821:17;1799:53;:::i;:::-;1868:16;;;;;1753:137;-1:-1:-1;;1753:137:1:o;1895:226::-;2071:42;2059:55;;;;2041:74;;2029:2;2014:18;;1996:125::o;2126:398::-;2338:42;2407:15;;;2389:34;;2459:15;;;;2454:2;2439:18;;2432:43;2506:2;2491:18;;2484:34;;;;2316:2;2301:18;;2283:241::o;2529:297::-;2733:42;2721:55;;;;2703:74;;2808:2;2793:18;;2786:34;2691:2;2676:18;;2658:168::o;3082:442::-;;3231:2;3220:9;3213:21;3263:6;3257:13;3306:6;3301:2;3290:9;3286:18;3279:34;3322:66;3381:6;3376:2;3365:9;3361:18;3356:2;3348:6;3344:15;3322:66;:::i;:::-;3440:2;3428:15;3445:66;3424:88;3409:104;;;;3515:2;3405:113;;3203:321;-1:-1:-1;;3203:321:1:o;3529:402::-;3731:2;3713:21;;;3770:2;3750:18;;;3743:30;3809:34;3804:2;3789:18;;3782:62;3880:8;3875:2;3860:18;;3853:36;3921:3;3906:19;;3703:228::o;3936:402::-;4138:2;4120:21;;;4177:2;4157:18;;;4150:30;4216:34;4211:2;4196:18;;4189:62;4287:8;4282:2;4267:18;;4260:36;4328:3;4313:19;;4110:228::o;4343:356::-;4545:2;4527:21;;;4564:18;;;4557:30;4623:34;4618:2;4603:18;;4596:62;4690:2;4675:18;;4517:182::o;4704:353::-;4906:2;4888:21;;;4945:2;4925:18;;;4918:30;4984:31;4979:2;4964:18;;4957:59;5048:2;5033:18;;4878:179::o;5062:406::-;5264:2;5246:21;;;5303:2;5283:18;;;5276:30;5342:34;5337:2;5322:18;;5315:62;5413:12;5408:2;5393:18;;5386:40;5458:3;5443:19;;5236:232::o;5473:258::-;5545:1;5555:113;5569:6;5566:1;5563:13;5555:113;;;5645:11;;;5639:18;5626:11;;;5619:39;5591:2;5584:10;5555:113;;;5686:6;5683:1;5680:13;5677:2;;;-1:-1:-1;;5721:1:1;5703:16;;5696:27;5526:205::o
Swarm Source
ipfs://ab62661474abad01a8ead0fb0a1c72f0b0032e0f272241e9e47d63d3fc96b431
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.