Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
Treasury
Compiler Version
v0.7.3+commit.9bfce1f6
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
pragma solidity ^0.7.3;
pragma experimental ABIEncoderV2;
import '@openzeppelin/contracts/token/ERC20/IERC20.sol';
import '@openzeppelin/contracts/token/ERC20/SafeERC20.sol';
import '@openzeppelin/contracts/math/SafeMath.sol';
import './interfaces/IUniswap.sol';
// Treasury for the trading service
contract Treasury {
/* Libraries */
using SafeERC20 for IERC20;
using SafeMath for uint256;
address internal constant uniswap = address(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
/* Variables */
// DAI
address public currency;
// user => balance (margin)
mapping(address => uint256) public balances;
// amount
uint256 public totalUserBalance;
// amount
uint256 public dailyWithdrawalLimit;
// amount
uint256 public withdrawalsSinceCheckpoint;
// block number
uint256 public withdrawalCheckpoint;
// amount
uint256 public dailyOracleFundingLimit;
// amount
uint256 public oracleFundingSinceCheckpoint;
// block number
uint256 public oracleFundingCheckpoint;
// amount
uint256 public systemFundsLimit;
IUniswap public uniswapRouter;
address public owner;
bool private initialized;
address private trading;
address private oracle;
event OracleFunded(uint256 amountSpent, uint256 amountFunded);
event SwappedOnUniswap(address currency1, address currency2, uint256 amountSpent, uint256 amountReceived);
event NewContracts(address _oracle, address _trading);
event NewWithdrawalLimit(uint256 amount);
event NewOracleFundingLimit(uint256 amount);
event NewSystemFundsLimit(uint256 amount);
function initialize(address _currency) public {
require(!initialized, '!initialized');
initialized = true;
owner = msg.sender;
uniswapRouter = IUniswap(uniswap);
currency = _currency;
}
function registerContracts(address _oracle, address _trading) external onlyOwner {
oracle = _oracle;
trading = _trading;
emit NewContracts(_oracle, _trading);
}
function setWithdrawalLimit(uint256 amount) external onlyOwner {
dailyWithdrawalLimit = amount;
emit NewWithdrawalLimit(amount);
}
function setOracleFundingLimit(uint256 amount) external onlyOwner {
dailyOracleFundingLimit = amount;
emit NewOracleFundingLimit(amount);
}
function setSystemFundsLimit(uint256 amount) external onlyOwner {
systemFundsLimit = amount;
emit NewSystemFundsLimit(amount);
}
function fundOracle(
uint256 amount
) external onlyOracle {
// Check oracle limits. 5760 = blocks in a day for 15s/block
if (oracleFundingCheckpoint.add(5760) < block.number) {
oracleFundingCheckpoint = block.number;
oracleFundingSinceCheckpoint = 0;
}
uint256 newOFSC = oracleFundingSinceCheckpoint.add(amount);
require(newOFSC <= dailyOracleFundingLimit, '!daily_limit');
oracleFundingSinceCheckpoint = newOFSC;
require(IERC20(currency).approve(address(uniswapRouter), amount), '!approve');
address[] memory path = new address[](2);
path[0] = currency;
path[1] = uniswapRouter.WETH();
uint[] memory amounts = uniswapRouter.swapExactTokensForETH(amount, 0, path, oracle, block.timestamp.add(1800));
emit OracleFunded(amount, amounts[1]);
}
function swapOnUniswap(
address[] calldata path,
uint256 amount
) external onlyOwner {
require(path.length > 1, '!invalid_path');
require(IERC20(path[0]).approve(address(uniswapRouter), amount), '!approve');
uint[] memory amounts = uniswapRouter.swapExactTokensForTokens(amount, 0, path, address(this), block.timestamp.add(1800));
emit SwappedOnUniswap(path[0], path[path.length - 1], amount, amounts[1]);
}
// all = true can be used to move funds to e.g. another treasury contract, including user balances
function withdraw(
uint256 amount,
address to,
bool all
) external onlyOwner {
if (!all) {
uint256 balance = IERC20(currency).balanceOf(address(this));
require(balance > totalUserBalance, '!balance1');
require(amount <= balance.sub(totalUserBalance), '!balance2');
}
IERC20(currency).safeTransfer(to, amount);
}
function userDeposit(
address user,
uint256 amount
) external onlyTrading {
IERC20(currency).safeTransferFrom(user, address(this), amount);
balances[user] = balances[user].add(amount);
totalUserBalance = totalUserBalance.add(amount);
}
function userWithdraw(
address user,
uint256 amount
) external onlyTrading {
uint256 userBalance = balances[user];
if (amount <= userBalance) {
// user can withdraw their treasury balance or less, regardless of daily limit
balances[user] = balances[user].sub(amount);
totalUserBalance = totalUserBalance.sub(amount);
IERC20(currency).safeTransfer(user, amount);
} else {
uint256 totalAvailableToWithdraw = IERC20(currency).balanceOf(address(this)).sub(totalUserBalance).sub(systemFundsLimit);
// user can withdraw more than their treasury balance (e.g. in profit)
uint256 surplusWithdrawal = amount.sub(userBalance);
require(surplusWithdrawal <= totalAvailableToWithdraw, '!system_threshold');
// check surplus against daily withdrawal (surplus) limit. 5760 = blocks in a day for 15s/block
if (withdrawalCheckpoint.add(5760) < block.number) {
withdrawalCheckpoint = block.number;
withdrawalsSinceCheckpoint = 0;
}
uint256 newWSC = withdrawalsSinceCheckpoint.add(surplusWithdrawal);
require(newWSC <= dailyWithdrawalLimit, '!daily_limit');
balances[user] = balances[user].sub(userBalance);
totalUserBalance = totalUserBalance.sub(userBalance);
IERC20(currency).safeTransfer(user, amount);
withdrawalsSinceCheckpoint = newWSC;
}
}
function collectFromUser(
address user,
uint256 amount
) external onlyTrading {
uint256 userBalance = balances[user];
if (userBalance > 0) {
if (amount >= userBalance) {
balances[user] = 0;
totalUserBalance = totalUserBalance.sub(userBalance, '!totalUserBalance');
} else {
balances[user] = userBalance.sub(amount);
totalUserBalance = totalUserBalance.sub(amount, '!totalUserBalance');
}
}
}
function getUserBalance(
address user
) public view returns (uint256) {
return balances[user];
}
function getTotalUserBalance() public view returns (uint256) {
return totalUserBalance;
}
/* Modifiers */
modifier onlyOwner() {
require(msg.sender == owner, '!authorized');
_;
}
modifier onlyTrading() {
require(msg.sender == trading, '!authorized');
_;
}
modifier onlyOracle() {
require(msg.sender == oracle, '!authorized');
_;
}
}// SPDX-License-Identifier: MIT
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);
}// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
import "./IERC20.sol";
import "../../math/SafeMath.sol";
import "../../utils/Address.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
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));
}
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero");
_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");
}
}
}// SPDX-License-Identifier: MIT
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;
}
}pragma solidity ^0.7.3;
interface IUniswap {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidity(
address tokenA,
address tokenB,
uint amountADesired,
uint amountBDesired,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB, uint liquidity);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
function removeLiquidity(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB);
function removeLiquidityETH(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountToken, uint amountETH);
function removeLiquidityWithPermit(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountA, uint amountB);
function removeLiquidityETHWithPermit(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountToken, uint amountETH);
function swapExactTokensForTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapTokensForExactTokens(
uint amountOut,
uint amountInMax,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
function removeLiquidityETHSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountETH);
function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountETH);
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external payable;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
}// SPDX-License-Identifier: MIT
pragma solidity >=0.6.2 <0.8.0;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
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;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain`call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
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);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.staticcall(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);
}
}
}
}{
"optimizer": {
"enabled": true,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"abi"
]
}
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_oracle","type":"address"},{"indexed":false,"internalType":"address","name":"_trading","type":"address"}],"name":"NewContracts","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"NewOracleFundingLimit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"NewSystemFundsLimit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"NewWithdrawalLimit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amountSpent","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountFunded","type":"uint256"}],"name":"OracleFunded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"currency1","type":"address"},{"indexed":false,"internalType":"address","name":"currency2","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountSpent","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountReceived","type":"uint256"}],"name":"SwappedOnUniswap","type":"event"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"balances","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"collectFromUser","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"currency","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"dailyOracleFundingLimit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"dailyWithdrawalLimit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"fundOracle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getTotalUserBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getUserBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_currency","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"oracleFundingCheckpoint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"oracleFundingSinceCheckpoint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_oracle","type":"address"},{"internalType":"address","name":"_trading","type":"address"}],"name":"registerContracts","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"setOracleFundingLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"setSystemFundsLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"setWithdrawalLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"swapOnUniswap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"systemFundsLimit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalUserBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"uniswapRouter","outputs":[{"internalType":"contract IUniswap","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"userDeposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"userWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"bool","name":"all","type":"bool"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawalCheckpoint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdrawalsSinceCheckpoint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]Contract Creation Code
608060405234801561001057600080fd5b506119b8806100206000396000f3fe608060405234801561001057600080fd5b50600436106101725760003560e01c8063735de9f7116100de578063b52d734311610097578063c4d66de811610071578063c4d66de8146102b2578063d5cae54b146102c5578063e5a6b10f146102d8578063f2fdfa82146102e057610172565b8063b52d734314610284578063b5c20dd314610297578063c4c0567b146102aa57610172565b8063735de9f7146102475780637620843a1461025c5780637896f49314610264578063824500ad1461026c5780638da5cb5b1461027457806390f7ab6b1461027c57610172565b80633e458a8e116101305780633e458a8e146101f65780634773489214610209578063583851531461021c57806359b29c8b146102245780635a0768ce1461022c5780636b06406c1461023f57610172565b8062ebf5dd1461017757806301ecfdcd1461018c5780630e79bba91461019f57806327ca57c0146101b257806327e235e3146101c55780632c30b257146101ee575b600080fd5b61018a6101853660046114c5565b6102f3565b005b61018a61019a366004611495565b61041a565b61018a6101ad366004611495565b610484565b61018a6101c0366004611300565b6104e3565b6101d86101d33660046112c8565b61057b565b6040516101e59190611812565b60405180910390f35b6101d861058d565b61018a610204366004611338565b610593565b6101d86102173660046112c8565b6107ce565b6101d86107e9565b6101d86107ef565b61018a61023a366004611495565b6107f5565b6101d8610854565b61024f61085a565b6040516101e59190611522565b6101d8610869565b6101d861086f565b6101d8610875565b61024f61087b565b6101d861088a565b61018a610292366004611338565b610890565b61018a6102a5366004611338565b610922565b6101d8610a34565b61018a6102c03660046112c8565b610a3a565b61018a6102d3366004611363565b610ac1565b61024f610d09565b61018a6102ee366004611495565b610d18565b600b546001600160a01b031633146103265760405162461bcd60e51b815260040161031d90611778565b60405180910390fd5b806103fe57600080546040516370a0823160e01b81526001600160a01b03909116906370a082319061035c903090600401611522565b60206040518083038186803b15801561037457600080fd5b505afa158015610388573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103ac91906114ad565b905060025481116103cf5760405162461bcd60e51b815260040161031d90611755565b6002546103dd90829061100b565b8411156103fc5760405162461bcd60e51b815260040161031d906116ae565b505b600054610415906001600160a01b03168385611054565b505050565b600b546001600160a01b031633146104445760405162461bcd60e51b815260040161031d90611778565b60068190556040517fa2999523d485007ac1b61aec8551fedf17231c3e229e67e8155fe640e63bcf5890610479908390611812565b60405180910390a150565b600b546001600160a01b031633146104ae5760405162461bcd60e51b815260040161031d90611778565b60098190556040517fca8c2e330e7c6da74421cb9623de3022103471b05b5a6899fa874b6ff31866ec90610479908390611812565b600b546001600160a01b0316331461050d5760405162461bcd60e51b815260040161031d90611778565b600d80546001600160a01b038085166001600160a01b031992831617909255600c8054928416929091169190911790556040517fa629594c1d3d5a71024ff9841d9e336f1fa62865a0087416e7b8f21fe26f04819061056f9084908490611536565b60405180910390a15050565b60016020526000908152604090205481565b60045481565b600c546001600160a01b031633146105bd5760405162461bcd60e51b815260040161031d90611778565b6001600160a01b038216600090815260016020526040902054808211610645576001600160a01b038316600090815260016020526040902054610600908361100b565b6001600160a01b038416600090815260016020526040902055600254610626908361100b565b600255600054610640906001600160a01b03168484611054565b610415565b600954600254600080546040516370a0823160e01b815291936106dc9390926106d6926001600160a01b0316906370a0823190610686903090600401611522565b60206040518083038186803b15801561069e57600080fd5b505afa1580156106b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106d691906114ad565b9061100b565b905060006106ea848461100b565b90508181111561070c5760405162461bcd60e51b815260040161031d906117e7565b600554439061071d906116806110aa565b101561072d574360055560006004555b60045460009061073d90836110aa565b90506003548111156107615760405162461bcd60e51b815260040161031d906116f8565b6001600160a01b038616600090815260016020526040902054610784908561100b565b6001600160a01b0387166000908152600160205260409020556002546107aa908561100b565b6002556000546107c4906001600160a01b03168787611054565b6004555050505050565b6001600160a01b031660009081526001602052604090205490565b60075481565b60085481565b600b546001600160a01b0316331461081f5760405162461bcd60e51b815260040161031d90611778565b60038190556040517f3c20dc6e6d0cdc400d31f18c2fd6d1571c8dcd631e52eb9504e0ff288bbb117390610479908390611812565b60025490565b600a546001600160a01b031681565b60035481565b60065481565b60095481565b600b546001600160a01b031681565b60055481565b600c546001600160a01b031633146108ba5760405162461bcd60e51b815260040161031d90611778565b6000546108d2906001600160a01b03168330846110cf565b6001600160a01b0382166000908152600160205260409020546108f590826110aa565b6001600160a01b03831660009081526001602052604090205560025461091b90826110aa565b6002555050565b600c546001600160a01b0316331461094c5760405162461bcd60e51b815260040161031d90611778565b6001600160a01b0382166000908152600160205260409020548015610415578082106109cc576001600160a01b0383166000908152600160209081526040808320929092558151808301909252601182527021746f74616c5573657242616c616e636560781b908201526002546109c49183906110f6565b600255610415565b6109d6818361100b565b6001600160a01b038416600090815260016020908152604091829020929092558051808201909152601181527021746f74616c5573657242616c616e636560781b91810191909152600254610a2c9184906110f6565b600255505050565b60025481565b600b54600160a01b900460ff1615610a645760405162461bcd60e51b815260040161031d906115e9565b600b80546001600160a01b031960ff60a01b19909116600160a01b1781163317909155600a80548216737a250d5630b4cf539739df2c5dacb4c659f2488d179055600080546001600160a01b039390931692909116919091179055565b600b546001600160a01b03163314610aeb5760405162461bcd60e51b815260040161031d90611778565b60018211610b0b5760405162461bcd60e51b815260040161031d906116d1565b82826000818110610b1857fe5b9050602002016020810190610b2d91906112c8565b600a5460405163095ea7b360e01b81526001600160a01b039283169263095ea7b392610b6092911690859060040161159d565b602060405180830381600087803b158015610b7a57600080fd5b505af1158015610b8e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bb29190611479565b610bce5760405162461bcd60e51b815260040161031d9061160f565b600a546060906001600160a01b03166338ed1739836000878730610bf4426107086110aa565b6040518763ffffffff1660e01b8152600401610c159695949392919061181b565b600060405180830381600087803b158015610c2f57600080fd5b505af1158015610c43573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610c6b91908101906113d8565b90507f5943288b296c39908983e7690f38fba1b2762ad47c6dcd09f81e3cea8472f3de84846000818110610c9b57fe5b9050602002016020810190610cb091906112c8565b85856000198101818110610cc057fe5b9050602002016020810190610cd591906112c8565b8484600181518110610ce357fe5b6020026020010151604051610cfb9493929190611574565b60405180910390a150505050565b6000546001600160a01b031681565b600d546001600160a01b03163314610d425760405162461bcd60e51b815260040161031d90611778565b6008544390610d53906116806110aa565b1015610d63574360085560006007555b600754600090610d7390836110aa565b9050600654811115610d975760405162461bcd60e51b815260040161031d906116f8565b6007819055600054600a5460405163095ea7b360e01b81526001600160a01b039283169263095ea7b392610dd292911690869060040161159d565b602060405180830381600087803b158015610dec57600080fd5b505af1158015610e00573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e249190611479565b610e405760405162461bcd60e51b815260040161031d9061160f565b604080516002808252606080830184529260208301908036833750506000805483519394506001600160a01b031692849250610e7857fe5b6001600160a01b03928316602091820292909201810191909152600a54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b158015610ecc57600080fd5b505afa158015610ee0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f0491906112e4565b81600181518110610f1157fe5b6001600160a01b039283166020918202929092010152600a54600d54606092918216916318cbafe5918791600091879116610f4e426107086110aa565b6040518663ffffffff1660e01b8152600401610f6e95949392919061188e565b600060405180830381600087803b158015610f8857600080fd5b505af1158015610f9c573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610fc491908101906113d8565b90507fdd6f444a33dfef547084a2c2beb039c4a6b08ad68ca9aa1afe8c9b6db5f20ce88482600181518110610ff557fe5b6020026020010151604051610cfb9291906118fe565b600061104d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506110f6565b9392505050565b6104158363a9059cbb60e01b848460405160240161107392919061159d565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611122565b60008282018381101561104d5760405162461bcd60e51b815260040161031d90611631565b6110f0846323b872dd60e01b85858560405160240161107393929190611550565b50505050565b6000818484111561111a5760405162461bcd60e51b815260040161031d91906115b6565b505050900390565b6060611177826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166111b19092919063ffffffff16565b80519091501561041557808060200190518101906111959190611479565b6104155760405162461bcd60e51b815260040161031d9061179d565b60606111c084846000856111c8565b949350505050565b6060824710156111ea5760405162461bcd60e51b815260040161031d90611668565b6111f385611289565b61120f5760405162461bcd60e51b815260040161031d9061171e565b60006060866001600160a01b0316858760405161122c9190611506565b60006040518083038185875af1925050503d8060008114611269576040519150601f19603f3d011682016040523d82523d6000602084013e61126e565b606091505b509150915061127e82828661128f565b979650505050505050565b3b151590565b6060831561129e57508161104d565b8251156112ae5782518084602001fd5b8160405162461bcd60e51b815260040161031d91906115b6565b6000602082840312156112d9578081fd5b813561104d8161195c565b6000602082840312156112f5578081fd5b815161104d8161195c565b60008060408385031215611312578081fd5b823561131d8161195c565b9150602083013561132d8161195c565b809150509250929050565b6000806040838503121561134a578182fd5b82356113558161195c565b946020939093013593505050565b600080600060408486031215611377578081fd5b833567ffffffffffffffff8082111561138e578283fd5b818601915086601f8301126113a1578283fd5b8135818111156113af578384fd5b87602080830285010111156113c2578384fd5b6020928301989097509590910135949350505050565b600060208083850312156113ea578182fd5b825167ffffffffffffffff80821115611401578384fd5b818501915085601f830112611414578384fd5b81518181111561142057fe5b838102915061143084830161190c565b8181528481019084860184860187018a101561144a578788fd5b8795505b8386101561146c57805183526001959095019491860191860161144e565b5098975050505050505050565b60006020828403121561148a578081fd5b815161104d81611974565b6000602082840312156114a6578081fd5b5035919050565b6000602082840312156114be578081fd5b5051919050565b6000806000606084860312156114d9578283fd5b8335925060208401356114eb8161195c565b915060408401356114fb81611974565b809150509250925092565b60008251611518818460208701611930565b9190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b0392831681529116602082015260400190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b0394851681529290931660208301526040820152606081019190915260800190565b6001600160a01b03929092168252602082015260400190565b60006020825282518060208401526115d5816040850160208701611930565b601f01601f19169190910160400192915050565b6020808252600c908201526b085a5b9a5d1a585b1a5e995960a21b604082015260600190565b60208082526008908201526721617070726f766560c01b604082015260600190565b6020808252601b908201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604082015260600190565b60208082526026908201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6040820152651c8818d85b1b60d21b606082015260800190565b60208082526009908201526810b130b630b731b29960b91b604082015260600190565b6020808252600d908201526c042d2dcecc2d8d2c8bee0c2e8d609b1b604082015260600190565b6020808252600c908201526b0859185a5b1e57db1a5b5a5d60a21b604082015260600190565b6020808252601d908201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604082015260600190565b6020808252600990820152682162616c616e63653160b81b604082015260600190565b6020808252600b908201526a08585d5d1a1bdc9a5e995960aa1b604082015260600190565b6020808252602a908201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6040820152691bdd081cdd58d8d9595960b21b606082015260800190565b602080825260119082015270085cde5cdd195b57dd1a1c995cda1bdb19607a1b604082015260600190565b90815260200190565b868152602080820187905260a0604083018190528201859052600090869060c08401835b8881101561186d5783356118528161195c565b6001600160a01b03168252928201929082019060010161183f565b506001600160a01b0396909616606085015250505060800152949350505050565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b818110156118dd5784516001600160a01b0316835293830193918301916001016118b8565b50506001600160a01b03969096166060850152505050608001529392505050565b918252602082015260400190565b60405181810167ffffffffffffffff8111828210171561192857fe5b604052919050565b60005b8381101561194b578181015183820152602001611933565b838111156110f05750506000910152565b6001600160a01b038116811461197157600080fd5b50565b801515811461197157600080fdfea2646970667358221220e99bb90e4457f58d774fbb953385d679474436ed79e43e03d6569d3eeb1af17f64736f6c63430007030033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101725760003560e01c8063735de9f7116100de578063b52d734311610097578063c4d66de811610071578063c4d66de8146102b2578063d5cae54b146102c5578063e5a6b10f146102d8578063f2fdfa82146102e057610172565b8063b52d734314610284578063b5c20dd314610297578063c4c0567b146102aa57610172565b8063735de9f7146102475780637620843a1461025c5780637896f49314610264578063824500ad1461026c5780638da5cb5b1461027457806390f7ab6b1461027c57610172565b80633e458a8e116101305780633e458a8e146101f65780634773489214610209578063583851531461021c57806359b29c8b146102245780635a0768ce1461022c5780636b06406c1461023f57610172565b8062ebf5dd1461017757806301ecfdcd1461018c5780630e79bba91461019f57806327ca57c0146101b257806327e235e3146101c55780632c30b257146101ee575b600080fd5b61018a6101853660046114c5565b6102f3565b005b61018a61019a366004611495565b61041a565b61018a6101ad366004611495565b610484565b61018a6101c0366004611300565b6104e3565b6101d86101d33660046112c8565b61057b565b6040516101e59190611812565b60405180910390f35b6101d861058d565b61018a610204366004611338565b610593565b6101d86102173660046112c8565b6107ce565b6101d86107e9565b6101d86107ef565b61018a61023a366004611495565b6107f5565b6101d8610854565b61024f61085a565b6040516101e59190611522565b6101d8610869565b6101d861086f565b6101d8610875565b61024f61087b565b6101d861088a565b61018a610292366004611338565b610890565b61018a6102a5366004611338565b610922565b6101d8610a34565b61018a6102c03660046112c8565b610a3a565b61018a6102d3366004611363565b610ac1565b61024f610d09565b61018a6102ee366004611495565b610d18565b600b546001600160a01b031633146103265760405162461bcd60e51b815260040161031d90611778565b60405180910390fd5b806103fe57600080546040516370a0823160e01b81526001600160a01b03909116906370a082319061035c903090600401611522565b60206040518083038186803b15801561037457600080fd5b505afa158015610388573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103ac91906114ad565b905060025481116103cf5760405162461bcd60e51b815260040161031d90611755565b6002546103dd90829061100b565b8411156103fc5760405162461bcd60e51b815260040161031d906116ae565b505b600054610415906001600160a01b03168385611054565b505050565b600b546001600160a01b031633146104445760405162461bcd60e51b815260040161031d90611778565b60068190556040517fa2999523d485007ac1b61aec8551fedf17231c3e229e67e8155fe640e63bcf5890610479908390611812565b60405180910390a150565b600b546001600160a01b031633146104ae5760405162461bcd60e51b815260040161031d90611778565b60098190556040517fca8c2e330e7c6da74421cb9623de3022103471b05b5a6899fa874b6ff31866ec90610479908390611812565b600b546001600160a01b0316331461050d5760405162461bcd60e51b815260040161031d90611778565b600d80546001600160a01b038085166001600160a01b031992831617909255600c8054928416929091169190911790556040517fa629594c1d3d5a71024ff9841d9e336f1fa62865a0087416e7b8f21fe26f04819061056f9084908490611536565b60405180910390a15050565b60016020526000908152604090205481565b60045481565b600c546001600160a01b031633146105bd5760405162461bcd60e51b815260040161031d90611778565b6001600160a01b038216600090815260016020526040902054808211610645576001600160a01b038316600090815260016020526040902054610600908361100b565b6001600160a01b038416600090815260016020526040902055600254610626908361100b565b600255600054610640906001600160a01b03168484611054565b610415565b600954600254600080546040516370a0823160e01b815291936106dc9390926106d6926001600160a01b0316906370a0823190610686903090600401611522565b60206040518083038186803b15801561069e57600080fd5b505afa1580156106b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106d691906114ad565b9061100b565b905060006106ea848461100b565b90508181111561070c5760405162461bcd60e51b815260040161031d906117e7565b600554439061071d906116806110aa565b101561072d574360055560006004555b60045460009061073d90836110aa565b90506003548111156107615760405162461bcd60e51b815260040161031d906116f8565b6001600160a01b038616600090815260016020526040902054610784908561100b565b6001600160a01b0387166000908152600160205260409020556002546107aa908561100b565b6002556000546107c4906001600160a01b03168787611054565b6004555050505050565b6001600160a01b031660009081526001602052604090205490565b60075481565b60085481565b600b546001600160a01b0316331461081f5760405162461bcd60e51b815260040161031d90611778565b60038190556040517f3c20dc6e6d0cdc400d31f18c2fd6d1571c8dcd631e52eb9504e0ff288bbb117390610479908390611812565b60025490565b600a546001600160a01b031681565b60035481565b60065481565b60095481565b600b546001600160a01b031681565b60055481565b600c546001600160a01b031633146108ba5760405162461bcd60e51b815260040161031d90611778565b6000546108d2906001600160a01b03168330846110cf565b6001600160a01b0382166000908152600160205260409020546108f590826110aa565b6001600160a01b03831660009081526001602052604090205560025461091b90826110aa565b6002555050565b600c546001600160a01b0316331461094c5760405162461bcd60e51b815260040161031d90611778565b6001600160a01b0382166000908152600160205260409020548015610415578082106109cc576001600160a01b0383166000908152600160209081526040808320929092558151808301909252601182527021746f74616c5573657242616c616e636560781b908201526002546109c49183906110f6565b600255610415565b6109d6818361100b565b6001600160a01b038416600090815260016020908152604091829020929092558051808201909152601181527021746f74616c5573657242616c616e636560781b91810191909152600254610a2c9184906110f6565b600255505050565b60025481565b600b54600160a01b900460ff1615610a645760405162461bcd60e51b815260040161031d906115e9565b600b80546001600160a01b031960ff60a01b19909116600160a01b1781163317909155600a80548216737a250d5630b4cf539739df2c5dacb4c659f2488d179055600080546001600160a01b039390931692909116919091179055565b600b546001600160a01b03163314610aeb5760405162461bcd60e51b815260040161031d90611778565b60018211610b0b5760405162461bcd60e51b815260040161031d906116d1565b82826000818110610b1857fe5b9050602002016020810190610b2d91906112c8565b600a5460405163095ea7b360e01b81526001600160a01b039283169263095ea7b392610b6092911690859060040161159d565b602060405180830381600087803b158015610b7a57600080fd5b505af1158015610b8e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bb29190611479565b610bce5760405162461bcd60e51b815260040161031d9061160f565b600a546060906001600160a01b03166338ed1739836000878730610bf4426107086110aa565b6040518763ffffffff1660e01b8152600401610c159695949392919061181b565b600060405180830381600087803b158015610c2f57600080fd5b505af1158015610c43573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610c6b91908101906113d8565b90507f5943288b296c39908983e7690f38fba1b2762ad47c6dcd09f81e3cea8472f3de84846000818110610c9b57fe5b9050602002016020810190610cb091906112c8565b85856000198101818110610cc057fe5b9050602002016020810190610cd591906112c8565b8484600181518110610ce357fe5b6020026020010151604051610cfb9493929190611574565b60405180910390a150505050565b6000546001600160a01b031681565b600d546001600160a01b03163314610d425760405162461bcd60e51b815260040161031d90611778565b6008544390610d53906116806110aa565b1015610d63574360085560006007555b600754600090610d7390836110aa565b9050600654811115610d975760405162461bcd60e51b815260040161031d906116f8565b6007819055600054600a5460405163095ea7b360e01b81526001600160a01b039283169263095ea7b392610dd292911690869060040161159d565b602060405180830381600087803b158015610dec57600080fd5b505af1158015610e00573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e249190611479565b610e405760405162461bcd60e51b815260040161031d9061160f565b604080516002808252606080830184529260208301908036833750506000805483519394506001600160a01b031692849250610e7857fe5b6001600160a01b03928316602091820292909201810191909152600a54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b158015610ecc57600080fd5b505afa158015610ee0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f0491906112e4565b81600181518110610f1157fe5b6001600160a01b039283166020918202929092010152600a54600d54606092918216916318cbafe5918791600091879116610f4e426107086110aa565b6040518663ffffffff1660e01b8152600401610f6e95949392919061188e565b600060405180830381600087803b158015610f8857600080fd5b505af1158015610f9c573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610fc491908101906113d8565b90507fdd6f444a33dfef547084a2c2beb039c4a6b08ad68ca9aa1afe8c9b6db5f20ce88482600181518110610ff557fe5b6020026020010151604051610cfb9291906118fe565b600061104d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506110f6565b9392505050565b6104158363a9059cbb60e01b848460405160240161107392919061159d565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611122565b60008282018381101561104d5760405162461bcd60e51b815260040161031d90611631565b6110f0846323b872dd60e01b85858560405160240161107393929190611550565b50505050565b6000818484111561111a5760405162461bcd60e51b815260040161031d91906115b6565b505050900390565b6060611177826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166111b19092919063ffffffff16565b80519091501561041557808060200190518101906111959190611479565b6104155760405162461bcd60e51b815260040161031d9061179d565b60606111c084846000856111c8565b949350505050565b6060824710156111ea5760405162461bcd60e51b815260040161031d90611668565b6111f385611289565b61120f5760405162461bcd60e51b815260040161031d9061171e565b60006060866001600160a01b0316858760405161122c9190611506565b60006040518083038185875af1925050503d8060008114611269576040519150601f19603f3d011682016040523d82523d6000602084013e61126e565b606091505b509150915061127e82828661128f565b979650505050505050565b3b151590565b6060831561129e57508161104d565b8251156112ae5782518084602001fd5b8160405162461bcd60e51b815260040161031d91906115b6565b6000602082840312156112d9578081fd5b813561104d8161195c565b6000602082840312156112f5578081fd5b815161104d8161195c565b60008060408385031215611312578081fd5b823561131d8161195c565b9150602083013561132d8161195c565b809150509250929050565b6000806040838503121561134a578182fd5b82356113558161195c565b946020939093013593505050565b600080600060408486031215611377578081fd5b833567ffffffffffffffff8082111561138e578283fd5b818601915086601f8301126113a1578283fd5b8135818111156113af578384fd5b87602080830285010111156113c2578384fd5b6020928301989097509590910135949350505050565b600060208083850312156113ea578182fd5b825167ffffffffffffffff80821115611401578384fd5b818501915085601f830112611414578384fd5b81518181111561142057fe5b838102915061143084830161190c565b8181528481019084860184860187018a101561144a578788fd5b8795505b8386101561146c57805183526001959095019491860191860161144e565b5098975050505050505050565b60006020828403121561148a578081fd5b815161104d81611974565b6000602082840312156114a6578081fd5b5035919050565b6000602082840312156114be578081fd5b5051919050565b6000806000606084860312156114d9578283fd5b8335925060208401356114eb8161195c565b915060408401356114fb81611974565b809150509250925092565b60008251611518818460208701611930565b9190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b0392831681529116602082015260400190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b0394851681529290931660208301526040820152606081019190915260800190565b6001600160a01b03929092168252602082015260400190565b60006020825282518060208401526115d5816040850160208701611930565b601f01601f19169190910160400192915050565b6020808252600c908201526b085a5b9a5d1a585b1a5e995960a21b604082015260600190565b60208082526008908201526721617070726f766560c01b604082015260600190565b6020808252601b908201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604082015260600190565b60208082526026908201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6040820152651c8818d85b1b60d21b606082015260800190565b60208082526009908201526810b130b630b731b29960b91b604082015260600190565b6020808252600d908201526c042d2dcecc2d8d2c8bee0c2e8d609b1b604082015260600190565b6020808252600c908201526b0859185a5b1e57db1a5b5a5d60a21b604082015260600190565b6020808252601d908201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604082015260600190565b6020808252600990820152682162616c616e63653160b81b604082015260600190565b6020808252600b908201526a08585d5d1a1bdc9a5e995960aa1b604082015260600190565b6020808252602a908201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6040820152691bdd081cdd58d8d9595960b21b606082015260800190565b602080825260119082015270085cde5cdd195b57dd1a1c995cda1bdb19607a1b604082015260600190565b90815260200190565b868152602080820187905260a0604083018190528201859052600090869060c08401835b8881101561186d5783356118528161195c565b6001600160a01b03168252928201929082019060010161183f565b506001600160a01b0396909616606085015250505060800152949350505050565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b818110156118dd5784516001600160a01b0316835293830193918301916001016118b8565b50506001600160a01b03969096166060850152505050608001529392505050565b918252602082015260400190565b60405181810167ffffffffffffffff8111828210171561192857fe5b604052919050565b60005b8381101561194b578181015183820152602001611933565b838111156110f05750506000910152565b6001600160a01b038116811461197157600080fd5b50565b801515811461197157600080fdfea2646970667358221220e99bb90e4457f58d774fbb953385d679474436ed79e43e03d6569d3eeb1af17f64736f6c63430007030033
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 33 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
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.