Source Code
Overview
ETH Balance
0 ETH
Token Holdings
More Info
ContractCreator
Multichain Info
N/A
Latest 7 from a total of 7 transactions
| Transaction Hash |
Method
|
Block
|
From
|
To
|
Amount
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Set Collateral K... | 11143225 | 651 days ago | IN | 0 ETH | 0.000002798131 | ||||
| Set Collateral K... | 11143222 | 651 days ago | IN | 0 ETH | 0.000002865457 | ||||
| Set Collateral K... | 11143218 | 651 days ago | IN | 0 ETH | 0.000002865462 | ||||
| Set Collateral K... | 11143214 | 651 days ago | IN | 0 ETH | 0.000002853637 | ||||
| Set Collateral K... | 11143210 | 651 days ago | IN | 0 ETH | 0.00000323008 | ||||
| Set Price Feed | 11143147 | 651 days ago | IN | 0 ETH | 0.000002922733 | ||||
| Set SUSD | 11143146 | 651 days ago | IN | 0 ETH | 0.000002918258 |
Loading...
Loading
Contract Name:
MockMultiCollateralOnOffRamp
Compiler Version
v0.8.20+commit.a1b79de6
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import "./MockPriceFeed.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "../../interfaces/ISportsAMMV2Manager.sol";
contract MockMultiCollateralOnOffRamp {
using SafeERC20 for IERC20;
address public priceFeed;
ISportsAMMV2Manager public manager;
IERC20 public sUSD;
mapping(address => bytes32) public collateralKey;
mapping(bytes32 => address) public collateralAddress;
mapping(address collateralFrom => mapping(address collateralTo => uint rate)) public swapRate;
receive() external payable {}
function setPriceFeed(address _priceFeed) external {
priceFeed = _priceFeed;
}
function setPositionalManager(address _mockPositionalManager) external {
manager = ISportsAMMV2Manager(_mockPositionalManager);
}
function setSUSD(address _sUSD) external {
sUSD = IERC20(_sUSD);
}
function setCollateralKey(address _collateral, bytes32 _collateralKey) external {
collateralKey[_collateral] = _collateralKey;
collateralAddress[_collateralKey] = _collateral;
}
function onramp(address _collateral, uint _collateralAmount) external returns (uint convertedAmount) {
// 1. Receive collateral amount from the sender
// 2. Convert to the USD amount
// 3. Send USD back to the sender
// REQUIRED: Contract needs to hold enough USD amount to execute
IERC20(_collateral).safeTransferFrom(msg.sender, address(this), _collateralAmount);
convertedAmount = getMinimumReceived(_collateral, _collateralAmount);
sUSD.safeTransfer(msg.sender, convertedAmount);
emit OnRamp(_collateral, _collateralAmount, convertedAmount);
}
function onrampWithEth(uint amount) external payable returns (uint) {}
function getMinimumReceived(address collateral, uint collateralAmount) public view returns (uint amountInUSD) {
if (
collateral == collateralAddress["USDC"] ||
collateral == collateralAddress["USDC2"] ||
collateral == collateralAddress["USDT"]
) {
amountInUSD = collateralAmount * (10 ** 12);
} else {
uint collateralInUSD = MockPriceFeed(priceFeed).rateForCurrency(collateralKey[collateral]);
amountInUSD = (collateralAmount * collateralInUSD) / 1e18;
}
// instead of mocking needsTransformingCollateral
// the check for decimals have been added in the mock
// this conversion follows the defaultCollateral in SportsAMMV2
// needsTransformingCollateral is in sync with it
if (ISportsAMMV2Manager(address(sUSD)).decimals() == 6) {
amountInUSD = amountInUSD / (10 ** 12);
} else {
amountInUSD = amountInUSD;
}
}
function getMinimumNeeded(address collateral, uint amount) public view returns (uint collateralQuote) {
// amount is buyInAmount,
// take priceFeed from collateral and generate the collateralQuote = pricePerUSD/buyInAmount
if (collateral == collateralAddress["USDC"]) {
collateralQuote = amount / (10 ** 12);
} else {
uint collateralInUSD = MockPriceFeed(priceFeed).rateForCurrency(collateralKey[collateral]);
collateralQuote = (amount * 1e18) / collateralInUSD;
}
}
function WETH9() external view returns (address) {
return collateralAddress["WETH"];
}
function offrampIntoEth(uint amount) external returns (uint offramped) {
sUSD.safeTransferFrom(msg.sender, address(this), amount);
offramped = _swapAmount(address(sUSD), collateralAddress["WETH"], amount);
// (bool sent, ) = payable(msg.sender).call{value: offramped}("");
bool sent = payable(msg.sender).send(offramped);
require(sent, "Failed to send Ether");
}
function offramp(address collateralTo, uint amount) external returns (uint offramped) {
sUSD.safeTransferFrom(msg.sender, address(this), amount);
offramped = _swapAmount(address(sUSD), collateralTo, amount);
IERC20(collateralTo).safeTransfer(msg.sender, offramped);
}
function offrampFromIntoEth(address collateralFrom, uint amount) external returns (uint offramped) {
IERC20(collateralFrom).safeTransferFrom(msg.sender, address(this), amount);
offramped = _swapAmount(collateralFrom, collateralAddress["WETH"], amount);
(bool sent, ) = payable(msg.sender).call{value: offramped}("");
// bool sent = payable(msg.sender).send(offramped);
require(sent, "Failed to send Ether");
}
function offrampFrom(address collateralFrom, address collateralTo, uint amount) external returns (uint offramped) {
IERC20(collateralFrom).safeTransferFrom(msg.sender, address(this), amount);
offramped = _swapAmount(collateralFrom, collateralTo, amount);
IERC20(collateralTo).safeTransfer(msg.sender, offramped);
}
function _swapAmount(address collateralFrom, address collateralTo, uint amount) internal view returns (uint) {
// assumed amount is 18 decimal
return (swapRate[collateralFrom][collateralTo] * amount) / 1e18;
}
function setSwapRate(address collateralFrom, address collateralTo, uint rate) external {
swapRate[collateralFrom][collateralTo] = rate;
swapRate[collateralTo][collateralFrom] = (1e18 * 1e18) / rate;
}
event OnRamp(address collateral, uint collateralAmount, uint convertedAmount);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
* presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
* need to send a transaction, and thus is not required to hold Ether at all.
*
* ==== Security Considerations
*
* There are two important considerations concerning the use of `permit`. The first is that a valid permit signature
* expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be
* considered as an intention to spend the allowance in any specific way. The second is that because permits have
* built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should
* take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be
* generally recommended is:
*
* ```solidity
* function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {
* try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}
* doThing(..., value);
* }
*
* function doThing(..., uint256 value) public {
* token.safeTransferFrom(msg.sender, address(this), value);
* ...
* }
* ```
*
* Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of
* `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also
* {SafeERC20-safeTransferFrom}).
*
* Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so
* contracts should have entry points that don't rely on permit.
*/
interface IERC20Permit {
/**
* @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
* given ``owner``'s signed approval.
*
* IMPORTANT: The same issues {IERC20-approve} has related to transaction
* ordering also apply here.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `deadline` must be a timestamp in the future.
* - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
* over the EIP712-formatted function arguments.
* - the signature must use ``owner``'s current nonce (see {nonces}).
*
* For more information on the signature format, see the
* https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
* section].
*
* CAUTION: See Security Considerations above.
*/
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
/**
* @dev Returns the current nonce for `owner`. This value must be
* included whenever a signature is generated for {permit}.
*
* Every successful call to {permit} increases ``owner``'s nonce by one. This
* prevents a signature from being used multiple times.
*/
function nonces(address owner) external view returns (uint256);
/**
* @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
*/
// solhint-disable-next-line func-name-mixedcase
function DOMAIN_SEPARATOR() external view returns (bytes32);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @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);
/**
* @dev Returns the value of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the value of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 value) 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 a `value` amount of tokens 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 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the
* allowance mechanism. `value` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 value) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.20;
import {IERC20} from "../IERC20.sol";
import {IERC20Permit} from "../extensions/IERC20Permit.sol";
import {Address} from "../../../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 Address for address;
/**
* @dev An operation with an ERC20 token failed.
*/
error SafeERC20FailedOperation(address token);
/**
* @dev Indicates a failed `decreaseAllowance` request.
*/
error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);
/**
* @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeTransfer(IERC20 token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));
}
/**
* @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
* calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
*/
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));
}
/**
* @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 oldAllowance = token.allowance(address(this), spender);
forceApprove(token, spender, oldAllowance + value);
}
/**
* @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no
* value, non-reverting calls are assumed to be successful.
*/
function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {
unchecked {
uint256 currentAllowance = token.allowance(address(this), spender);
if (currentAllowance < requestedDecrease) {
revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);
}
forceApprove(token, spender, currentAllowance - requestedDecrease);
}
}
/**
* @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
* to be set to zero before setting it to a non-zero value, such as USDT.
*/
function forceApprove(IERC20 token, address spender, uint256 value) internal {
bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));
if (!_callOptionalReturnBool(token, approvalCall)) {
_callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));
_callOptionalReturn(token, approvalCall);
}
}
/**
* @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);
if (returndata.length != 0 && !abi.decode(returndata, (bool))) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @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).
*
* This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
*/
function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
// 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 cannot use {Address-functionCall} here since this should return false
// and not revert is the subcall reverts.
(bool success, bytes memory returndata) = address(token).call(data);
return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && address(token).code.length > 0;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)
pragma solidity ^0.8.20;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev The ETH balance of the account is not enough to perform the operation.
*/
error AddressInsufficientBalance(address account);
/**
* @dev There's no code at `target` (it is not a contract).
*/
error AddressEmptyCode(address target);
/**
* @dev A call to an address target failed. The target may have reverted.
*/
error FailedInnerCall();
/**
* @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://consensys.net/diligence/blog/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.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
if (address(this).balance < amount) {
revert AddressInsufficientBalance(address(this));
}
(bool success, ) = recipient.call{value: amount}("");
if (!success) {
revert FailedInnerCall();
}
}
/**
* @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 or custom error, it is bubbled
* up by this function (like regular Solidity function calls). However, if
* the call reverted with no returned reason, this function reverts with a
* {FailedInnerCall} error.
*
* 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.
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0);
}
/**
* @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`.
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
if (address(this).balance < value) {
revert AddressInsufficientBalance(address(this));
}
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target
* was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an
* unsuccessful call.
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata
) internal view returns (bytes memory) {
if (!success) {
_revert(returndata);
} else {
// only check if target is a contract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
if (returndata.length == 0 && target.code.length == 0) {
revert AddressEmptyCode(target);
}
return returndata;
}
}
/**
* @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the
* revert reason or with a default {FailedInnerCall} error.
*/
function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {
if (!success) {
_revert(returndata);
} else {
return returndata;
}
}
/**
* @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.
*/
function _revert(bytes memory returndata) private pure {
// 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
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert FailedInnerCall();
}
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "../interfaces/ISportsAMMV2Manager.sol";
import "../interfaces/ISportsAMMV2ResultManager.sol";
import "../interfaces/ISportsAMMV2RiskManager.sol";
import "../interfaces/ISportsAMMV2Manager.sol";
interface ISportsAMMV2 {
struct CombinedPosition {
uint16 typeId;
uint8 position;
int24 line;
}
struct TradeData {
bytes32 gameId;
uint16 sportId;
uint16 typeId;
uint maturity;
uint8 status;
int24 line;
uint16 playerId;
uint[] odds;
bytes32[] merkleProof;
uint8 position;
CombinedPosition[][] combinedPositions;
}
function defaultCollateral() external view returns (IERC20);
function manager() external view returns (ISportsAMMV2Manager);
function resultManager() external view returns (ISportsAMMV2ResultManager);
function safeBoxFee() external view returns (uint);
function exerciseTicket(address _ticket) external;
function riskManager() external view returns (ISportsAMMV2RiskManager);
function tradeLive(
TradeData[] calldata _tradeData,
uint _buyInAmount,
uint _expectedQuote,
address _recipient,
address _referrer,
address _collateral
) external returns (address _createdTicket);
function trade(
TradeData[] calldata _tradeData,
uint _buyInAmount,
uint _expectedQuote,
uint _additionalSlippage,
address _referrer,
address _collateral,
bool _isEth
) external returns (address _createdTicket);
function rootPerGame(bytes32 game) external view returns (bytes32);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import "./ISportsAMMV2.sol";
interface ISportsAMMV2Manager {
enum Role {
ROOT_SETTING,
RISK_MANAGING,
MARKET_RESOLVING,
TICKET_PAUSER
}
function isWhitelistedAddress(address _address, Role role) external view returns (bool);
function decimals() external view returns (uint);
function feeToken() external view returns (address);
function isActiveTicket(address _ticket) external view returns (bool);
function getActiveTickets(uint _index, uint _pageSize) external view returns (address[] memory);
function numOfActiveTickets() external view returns (uint);
function getActiveTicketsPerUser(uint _index, uint _pageSize, address _user) external view returns (address[] memory);
function numOfActiveTicketsPerUser(address _user) external view returns (uint);
function getResolvedTicketsPerUser(uint _index, uint _pageSize, address _user) external view returns (address[] memory);
function numOfResolvedTicketsPerUser(address _user) external view returns (uint);
function getTicketsPerGame(uint _index, uint _pageSize, bytes32 _gameId) external view returns (address[] memory);
function numOfTicketsPerGame(bytes32 _gameId) external view returns (uint);
function isKnownTicket(address _ticket) external view returns (bool);
function addNewKnownTicket(ISportsAMMV2.TradeData[] memory _tradeData, address ticket, address user) external;
function resolveKnownTicket(address ticket, address ticketOwner) external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "./ISportsAMMV2.sol";
interface ISportsAMMV2ResultManager {
enum MarketPositionStatus {
Open,
Cancelled,
Winning,
Losing
}
function isMarketResolved(
bytes32 _gameId,
uint16 _typeId,
uint16 _playerId,
int24 _line,
ISportsAMMV2.CombinedPosition[] memory combinedPositions
) external view returns (bool isResolved);
function getMarketPositionStatus(
bytes32 _gameId,
uint16 _typeId,
uint16 _playerId,
int24 _line,
uint _position,
ISportsAMMV2.CombinedPosition[] memory _combinedPositions
) external view returns (MarketPositionStatus status);
function isWinningMarketPosition(
bytes32 _gameId,
uint16 _typeId,
uint16 _playerId,
int24 _line,
uint _position,
ISportsAMMV2.CombinedPosition[] memory _combinedPositions
) external view returns (bool isWinning);
function isCancelledMarketPosition(
bytes32 _gameId,
uint16 _typeId,
uint16 _playerId,
int24 _line,
uint _position,
ISportsAMMV2.CombinedPosition[] memory _combinedPositions
) external view returns (bool isCancelled);
function getResultsPerMarket(
bytes32 _gameId,
uint16 _typeId,
uint16 _playerId
) external view returns (int24[] memory results);
function setResultsPerMarkets(
bytes32[] memory _gameIds,
uint16[] memory _typeIds,
uint16[] memory _playerIds,
int24[][] memory _results
) external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import "./ISportsAMMV2.sol";
interface ISportsAMMV2RiskManager {
struct TypeCap {
uint typeId;
uint cap;
}
struct CapData {
uint capPerSport;
uint capPerChild;
TypeCap[] capPerType;
}
struct DynamicLiquidityData {
uint cutoffTimePerSport;
uint cutoffDividerPerSport;
}
struct RiskData {
uint sportId;
CapData capData;
uint riskMultiplierPerSport;
DynamicLiquidityData dynamicLiquidityData;
}
enum RiskStatus {
NoRisk,
OutOfLiquidity,
InvalidCombination
}
function minBuyInAmount() external view returns (uint);
function maxTicketSize() external view returns (uint);
function maxSupportedAmount() external view returns (uint);
function maxSupportedOdds() external view returns (uint);
function expiryDuration() external view returns (uint);
function liveTradingPerSportAndTypeEnabled(uint _sportId, uint _typeId) external view returns (bool _enabled);
function calculateCapToBeUsed(
bytes32 _gameId,
uint16 _sportId,
uint16 _typeId,
uint16 _playerId,
int24 _line,
uint _maturity
) external view returns (uint cap);
function checkRisks(
ISportsAMMV2.TradeData[] memory _tradeData,
uint _buyInAmount
) external view returns (ISportsAMMV2RiskManager.RiskStatus riskStatus, bool[] memory isMarketOutOfLiquidity);
function checkLimits(
uint _buyInAmount,
uint _totalQuote,
uint _payout,
uint _expectedPayout,
uint _additionalSlippage
) external view;
function checkAndUpdateRisks(ISportsAMMV2.TradeData[] memory _tradeData, uint _buyInAmount) external;
function verifyMerkleTree(ISportsAMMV2.TradeData memory _marketTradeData, bytes32 _rootPerGame) external pure;
}// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.20;
// external
contract MockPriceFeed {
mapping(bytes32 => uint8) public currencyKeyDecimals;
// List of currency keys for convenient iteration
bytes32[] public currencyKeys;
address public WETH9;
uint public priceForETHinUSD;
uint public defaultCollateralDecimals;
mapping(address => uint) public collateralPriceInUSD;
mapping(bytes32 => address) public collateralAddressForKey;
constructor() {
currencyKeys.push("ETH");
priceForETHinUSD = 3500 * 1e18;
}
struct RateAndUpdatedTime {
uint rate;
uint40 time;
}
function getCurrencies() external view returns (bytes32[] memory) {
return currencyKeys;
}
function getRates() external view returns (uint[] memory rates) {
rates = new uint[](currencyKeys.length);
for (uint i = 0; i < currencyKeys.length; i++) {
bytes32 currencyKey = currencyKeys[i];
rates[i] = _getRateAndUpdatedTime(currencyKey).rate;
}
}
function rateForCurrency(bytes32 currencyKey) external view returns (uint) {
return _getRateAndUpdatedTime(currencyKey).rate;
}
function transformCollateral(address _collateral, uint _collateralAmount) external view returns (uint amountInUSD) {
amountInUSD = (_collateralAmount * collateralPriceInUSD[_collateral]) / (10 ** (18 - defaultCollateralDecimals));
}
function setPriceFeedForCollateral(bytes32 _collateralKey, address _collateral, uint _priceInUSD) external {
currencyKeys.push(_collateralKey);
collateralAddressForKey[_collateralKey] = _collateral;
collateralPriceInUSD[_collateral] = _priceInUSD;
}
function setWETH9(address _WETH9) external {
WETH9 = _WETH9;
}
function setPriceForETH(uint _priceInUSD) external {
priceForETHinUSD = _priceInUSD;
}
function setDefaultCollateralDecimals(uint _decimals) external {
defaultCollateralDecimals = _decimals;
}
function _getRateAndUpdatedTime(bytes32 currencyKey) internal view returns (RateAndUpdatedTime memory) {
require(collateralAddressForKey[currencyKey] != address(0) || currencyKey == currencyKeys[0], "Invalid key");
if (currencyKey == currencyKeys[0]) {
return RateAndUpdatedTime({rate: priceForETHinUSD, time: uint40(block.timestamp)});
} else {
return
RateAndUpdatedTime({
rate: collateralPriceInUSD[collateralAddressForKey[currencyKey]],
time: uint40(block.timestamp)
});
}
}
}{
"optimizer": {
"enabled": true,
"runs": 200
},
"evmVersion": "paris",
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}Contract ABI
API[{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"AddressInsufficientBalance","type":"error"},{"inputs":[],"name":"FailedInnerCall","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"collateral","type":"address"},{"indexed":false,"internalType":"uint256","name":"collateralAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"convertedAmount","type":"uint256"}],"name":"OnRamp","type":"event"},{"inputs":[],"name":"WETH9","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"collateralAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"collateralKey","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"collateral","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"getMinimumNeeded","outputs":[{"internalType":"uint256","name":"collateralQuote","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"collateral","type":"address"},{"internalType":"uint256","name":"collateralAmount","type":"uint256"}],"name":"getMinimumReceived","outputs":[{"internalType":"uint256","name":"amountInUSD","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"contract ISportsAMMV2Manager","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"collateralTo","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"offramp","outputs":[{"internalType":"uint256","name":"offramped","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"collateralFrom","type":"address"},{"internalType":"address","name":"collateralTo","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"offrampFrom","outputs":[{"internalType":"uint256","name":"offramped","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"collateralFrom","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"offrampFromIntoEth","outputs":[{"internalType":"uint256","name":"offramped","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"offrampIntoEth","outputs":[{"internalType":"uint256","name":"offramped","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_collateral","type":"address"},{"internalType":"uint256","name":"_collateralAmount","type":"uint256"}],"name":"onramp","outputs":[{"internalType":"uint256","name":"convertedAmount","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"onrampWithEth","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"priceFeed","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"sUSD","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_collateral","type":"address"},{"internalType":"bytes32","name":"_collateralKey","type":"bytes32"}],"name":"setCollateralKey","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_mockPositionalManager","type":"address"}],"name":"setPositionalManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_priceFeed","type":"address"}],"name":"setPriceFeed","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_sUSD","type":"address"}],"name":"setSUSD","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"collateralFrom","type":"address"},{"internalType":"address","name":"collateralTo","type":"address"},{"internalType":"uint256","name":"rate","type":"uint256"}],"name":"setSwapRate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"collateralFrom","type":"address"},{"internalType":"address","name":"collateralTo","type":"address"}],"name":"swapRate","outputs":[{"internalType":"uint256","name":"rate","type":"uint256"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]Contract Creation Code
608060405234801561001057600080fd5b50610f52806100206000396000f3fe6080604052600436106101235760003560e01c8063741bef1a116100a0578063b707fb8411610064578063b707fb84146103ca578063bee87526146103ea578063cb4ba52414610417578063d9775f2f14610437578063fe6dbca61461046f57600080fd5b8063741bef1a1461032a5780638826e5de1461034a5780638b3ac44c1461036a5780639324cac71461038a578063b45e98d9146103aa57600080fd5b80634aa4a4fc116100e75780634aa4a4fc146102235780634b2e0269146102705780634c9323681461029057806350c2a42b146102b0578063724e78da146102ed57600080fd5b8063015ab8171461012f5780630a09b591146101515780631321b85d146101a457806321ef44c6146101c6578063481c6a751461020357600080fd5b3661012a57005b600080fd5b34801561013b57600080fd5b5061014f61014a366004610d9e565b6104c7565b005b34801561015d57600080fd5b5061018761016c366004610dda565b6004602052600090815260409020546001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6101b86101b2366004610dda565b50600090565b60405190815260200161019b565b3480156101d257600080fd5b5061014f6101e1366004610df3565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b34801561020f57600080fd5b50600154610187906001600160a01b031681565b34801561022f57600080fd5b50630ae8aa8960e31b60005260046020527f6c6dba33c46363b8b7eea88860ee3afc44cd7a2c4f9238b927d748916e372d26546001600160a01b0316610187565b34801561027c57600080fd5b506101b861028b366004610d9e565b610536565b34801561029c57600080fd5b506101b86102ab366004610e0e565b610575565b3480156102bc57600080fd5b5061014f6102cb366004610df3565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b3480156102f957600080fd5b5061014f610308366004610df3565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b34801561033657600080fd5b50600054610187906001600160a01b031681565b34801561035657600080fd5b506101b8610365366004610e0e565b6105c3565b34801561037657600080fd5b506101b8610385366004610e0e565b6106c4565b34801561039657600080fd5b50600254610187906001600160a01b031681565b3480156103b657600080fd5b506101b86103c5366004610dda565b61074f565b3480156103d657600080fd5b506101b86103e5366004610e0e565b610828565b3480156103f657600080fd5b506101b8610405366004610df3565b60036020526000908152604090205481565b34801561042357600080fd5b506101b8610432366004610e0e565b61091f565b34801561044357600080fd5b506101b8610452366004610e38565b600560209081526000928352604080842090915290825290205481565b34801561047b57600080fd5b5061014f61048a366004610e0e565b6001600160a01b039091166000818152600360209081526040808320859055938252600490529190912080546001600160a01b0319169091179055565b6001600160a01b038084166000908152600560209081526040808320938616835292905220819055610508816ec097ce7bc90715b34b9f1000000000610e6b565b6001600160a01b03928316600090815260056020908152604080832096909516825294909452919092205550565b600061054d6001600160a01b038516333085610b38565b610558848484610ba5565b905061056e6001600160a01b0384163383610be2565b9392505050565b600254600090610590906001600160a01b0316333085610b38565b6002546105a7906001600160a01b03168484610ba5565b90506105bd6001600160a01b0384163383610be2565b92915050565b635553444360e01b600090815260046020527ffc222f0ac3e8ec5d72a1ee6fc08a2effbdf59ce4c70b15039ef2450cdacd603c546001600160a01b03908116908416036106205761061964e8d4a5100083610e6b565b90506105bd565b600080546001600160a01b038581168352600360205260408084205490516315905ec160e31b8152600481019190915291169063ac82f60890602401602060405180830381865afa158015610679573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061069d9190610e8d565b9050806106b284670de0b6b3a7640000610ea6565b6106bc9190610e6b565b949350505050565b60006106db6001600160a01b038416333085610b38565b6106e5838361091f565b6002549091506106ff906001600160a01b03163383610be2565b604080516001600160a01b0385168152602081018490529081018290527fdec12362527dfa6002b41dcff6c42b665e16f302f6db35ac6ee464e5854622329060600160405180910390a192915050565b60025460009061076a906001600160a01b0316333085610b38565b600254630ae8aa8960e31b60005260046020527f6c6dba33c46363b8b7eea88860ee3afc44cd7a2c4f9238b927d748916e372d26546107b6916001600160a01b03908116911684610ba5565b604051909150600090339083156108fc0290849084818181858888f193505050509050806108225760405162461bcd60e51b81526020600482015260146024820152732330b4b632b2103a379039b2b7321022ba3432b960611b60448201526064015b60405180910390fd5b50919050565b600061083f6001600160a01b038416333085610b38565b630ae8aa8960e31b60005260046020527f6c6dba33c46363b8b7eea88860ee3afc44cd7a2c4f9238b927d748916e372d26546108869084906001600160a01b031684610ba5565b604051909150600090339083908381818185875af1925050503d80600081146108cb576040519150601f19603f3d011682016040523d82523d6000602084013e6108d0565b606091505b50509050806109185760405162461bcd60e51b81526020600482015260146024820152732330b4b632b2103a379039b2b7321022ba3432b960611b6044820152606401610819565b5092915050565b635553444360e01b600090815260046020527ffc222f0ac3e8ec5d72a1ee6fc08a2effbdf59ce4c70b15039ef2450cdacd603c546001600160a01b03848116911614806109a95750642aa9a2219960d91b60005260046020527f853ee9abf2328c58d35f3910aa8344d18730eb6c6dc242e8f627c143647ed8b2546001600160a01b038481169116145b806109f05750631554d11560e21b60005260046020527f273c837f0c39fc84ddfcba61d7bf0239ba0cc221abe8ac9957010225491f9e7b546001600160a01b038481169116145b15610a0b57610a048264e8d4a51000610ea6565b9050610aab565b600080546001600160a01b038581168352600360205260408084205490516315905ec160e31b8152600481019190915291169063ac82f60890602401602060405180830381865afa158015610a64573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a889190610e8d565b9050670de0b6b3a7640000610a9d8285610ea6565b610aa79190610e6b565b9150505b600260009054906101000a90046001600160a01b03166001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610afe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b229190610e8d565b6006036105bd5761061964e8d4a5100082610e6b565b6040516001600160a01b038481166024830152838116604483015260648201839052610b9f9186918216906323b872dd906084015b604051602081830303815290604052915060e01b6020820180516001600160e01b038381831617835250505050610c18565b50505050565b6001600160a01b038084166000908152600560209081526040808320938616835292905290812054670de0b6b3a7640000906106b2908490610ea6565b6040516001600160a01b03838116602483015260448201839052610c1391859182169063a9059cbb90606401610b6d565b505050565b6000610c2d6001600160a01b03841683610c7b565b90508051600014158015610c52575080806020019051810190610c509190610ecb565b155b15610c1357604051635274afe760e01b81526001600160a01b0384166004820152602401610819565b606061056e8383600084600080856001600160a01b03168486604051610ca19190610eed565b60006040518083038185875af1925050503d8060008114610cde576040519150601f19603f3d011682016040523d82523d6000602084013e610ce3565b606091505b5091509150610cf3868383610cfd565b9695505050505050565b606082610d1257610d0d82610d59565b61056e565b8151158015610d2957506001600160a01b0384163b155b15610d5257604051639996b31560e01b81526001600160a01b0385166004820152602401610819565b508061056e565b805115610d695780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b80356001600160a01b0381168114610d9957600080fd5b919050565b600080600060608486031215610db357600080fd5b610dbc84610d82565b9250610dca60208501610d82565b9150604084013590509250925092565b600060208284031215610dec57600080fd5b5035919050565b600060208284031215610e0557600080fd5b61056e82610d82565b60008060408385031215610e2157600080fd5b610e2a83610d82565b946020939093013593505050565b60008060408385031215610e4b57600080fd5b610e5483610d82565b9150610e6260208401610d82565b90509250929050565b600082610e8857634e487b7160e01b600052601260045260246000fd5b500490565b600060208284031215610e9f57600080fd5b5051919050565b80820281158282048414176105bd57634e487b7160e01b600052601160045260246000fd5b600060208284031215610edd57600080fd5b8151801515811461056e57600080fd5b6000825160005b81811015610f0e5760208186018101518583015201610ef4565b50600092019182525091905056fea26469706673582212203eec941eb7de5ec8236b95b04e1668c186e6d1a14509010914c131561ebbb2b464736f6c63430008140033
Deployed Bytecode
0x6080604052600436106101235760003560e01c8063741bef1a116100a0578063b707fb8411610064578063b707fb84146103ca578063bee87526146103ea578063cb4ba52414610417578063d9775f2f14610437578063fe6dbca61461046f57600080fd5b8063741bef1a1461032a5780638826e5de1461034a5780638b3ac44c1461036a5780639324cac71461038a578063b45e98d9146103aa57600080fd5b80634aa4a4fc116100e75780634aa4a4fc146102235780634b2e0269146102705780634c9323681461029057806350c2a42b146102b0578063724e78da146102ed57600080fd5b8063015ab8171461012f5780630a09b591146101515780631321b85d146101a457806321ef44c6146101c6578063481c6a751461020357600080fd5b3661012a57005b600080fd5b34801561013b57600080fd5b5061014f61014a366004610d9e565b6104c7565b005b34801561015d57600080fd5b5061018761016c366004610dda565b6004602052600090815260409020546001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6101b86101b2366004610dda565b50600090565b60405190815260200161019b565b3480156101d257600080fd5b5061014f6101e1366004610df3565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b34801561020f57600080fd5b50600154610187906001600160a01b031681565b34801561022f57600080fd5b50630ae8aa8960e31b60005260046020527f6c6dba33c46363b8b7eea88860ee3afc44cd7a2c4f9238b927d748916e372d26546001600160a01b0316610187565b34801561027c57600080fd5b506101b861028b366004610d9e565b610536565b34801561029c57600080fd5b506101b86102ab366004610e0e565b610575565b3480156102bc57600080fd5b5061014f6102cb366004610df3565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b3480156102f957600080fd5b5061014f610308366004610df3565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b34801561033657600080fd5b50600054610187906001600160a01b031681565b34801561035657600080fd5b506101b8610365366004610e0e565b6105c3565b34801561037657600080fd5b506101b8610385366004610e0e565b6106c4565b34801561039657600080fd5b50600254610187906001600160a01b031681565b3480156103b657600080fd5b506101b86103c5366004610dda565b61074f565b3480156103d657600080fd5b506101b86103e5366004610e0e565b610828565b3480156103f657600080fd5b506101b8610405366004610df3565b60036020526000908152604090205481565b34801561042357600080fd5b506101b8610432366004610e0e565b61091f565b34801561044357600080fd5b506101b8610452366004610e38565b600560209081526000928352604080842090915290825290205481565b34801561047b57600080fd5b5061014f61048a366004610e0e565b6001600160a01b039091166000818152600360209081526040808320859055938252600490529190912080546001600160a01b0319169091179055565b6001600160a01b038084166000908152600560209081526040808320938616835292905220819055610508816ec097ce7bc90715b34b9f1000000000610e6b565b6001600160a01b03928316600090815260056020908152604080832096909516825294909452919092205550565b600061054d6001600160a01b038516333085610b38565b610558848484610ba5565b905061056e6001600160a01b0384163383610be2565b9392505050565b600254600090610590906001600160a01b0316333085610b38565b6002546105a7906001600160a01b03168484610ba5565b90506105bd6001600160a01b0384163383610be2565b92915050565b635553444360e01b600090815260046020527ffc222f0ac3e8ec5d72a1ee6fc08a2effbdf59ce4c70b15039ef2450cdacd603c546001600160a01b03908116908416036106205761061964e8d4a5100083610e6b565b90506105bd565b600080546001600160a01b038581168352600360205260408084205490516315905ec160e31b8152600481019190915291169063ac82f60890602401602060405180830381865afa158015610679573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061069d9190610e8d565b9050806106b284670de0b6b3a7640000610ea6565b6106bc9190610e6b565b949350505050565b60006106db6001600160a01b038416333085610b38565b6106e5838361091f565b6002549091506106ff906001600160a01b03163383610be2565b604080516001600160a01b0385168152602081018490529081018290527fdec12362527dfa6002b41dcff6c42b665e16f302f6db35ac6ee464e5854622329060600160405180910390a192915050565b60025460009061076a906001600160a01b0316333085610b38565b600254630ae8aa8960e31b60005260046020527f6c6dba33c46363b8b7eea88860ee3afc44cd7a2c4f9238b927d748916e372d26546107b6916001600160a01b03908116911684610ba5565b604051909150600090339083156108fc0290849084818181858888f193505050509050806108225760405162461bcd60e51b81526020600482015260146024820152732330b4b632b2103a379039b2b7321022ba3432b960611b60448201526064015b60405180910390fd5b50919050565b600061083f6001600160a01b038416333085610b38565b630ae8aa8960e31b60005260046020527f6c6dba33c46363b8b7eea88860ee3afc44cd7a2c4f9238b927d748916e372d26546108869084906001600160a01b031684610ba5565b604051909150600090339083908381818185875af1925050503d80600081146108cb576040519150601f19603f3d011682016040523d82523d6000602084013e6108d0565b606091505b50509050806109185760405162461bcd60e51b81526020600482015260146024820152732330b4b632b2103a379039b2b7321022ba3432b960611b6044820152606401610819565b5092915050565b635553444360e01b600090815260046020527ffc222f0ac3e8ec5d72a1ee6fc08a2effbdf59ce4c70b15039ef2450cdacd603c546001600160a01b03848116911614806109a95750642aa9a2219960d91b60005260046020527f853ee9abf2328c58d35f3910aa8344d18730eb6c6dc242e8f627c143647ed8b2546001600160a01b038481169116145b806109f05750631554d11560e21b60005260046020527f273c837f0c39fc84ddfcba61d7bf0239ba0cc221abe8ac9957010225491f9e7b546001600160a01b038481169116145b15610a0b57610a048264e8d4a51000610ea6565b9050610aab565b600080546001600160a01b038581168352600360205260408084205490516315905ec160e31b8152600481019190915291169063ac82f60890602401602060405180830381865afa158015610a64573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a889190610e8d565b9050670de0b6b3a7640000610a9d8285610ea6565b610aa79190610e6b565b9150505b600260009054906101000a90046001600160a01b03166001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610afe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b229190610e8d565b6006036105bd5761061964e8d4a5100082610e6b565b6040516001600160a01b038481166024830152838116604483015260648201839052610b9f9186918216906323b872dd906084015b604051602081830303815290604052915060e01b6020820180516001600160e01b038381831617835250505050610c18565b50505050565b6001600160a01b038084166000908152600560209081526040808320938616835292905290812054670de0b6b3a7640000906106b2908490610ea6565b6040516001600160a01b03838116602483015260448201839052610c1391859182169063a9059cbb90606401610b6d565b505050565b6000610c2d6001600160a01b03841683610c7b565b90508051600014158015610c52575080806020019051810190610c509190610ecb565b155b15610c1357604051635274afe760e01b81526001600160a01b0384166004820152602401610819565b606061056e8383600084600080856001600160a01b03168486604051610ca19190610eed565b60006040518083038185875af1925050503d8060008114610cde576040519150601f19603f3d011682016040523d82523d6000602084013e610ce3565b606091505b5091509150610cf3868383610cfd565b9695505050505050565b606082610d1257610d0d82610d59565b61056e565b8151158015610d2957506001600160a01b0384163b155b15610d5257604051639996b31560e01b81526001600160a01b0385166004820152602401610819565b508061056e565b805115610d695780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b80356001600160a01b0381168114610d9957600080fd5b919050565b600080600060608486031215610db357600080fd5b610dbc84610d82565b9250610dca60208501610d82565b9150604084013590509250925092565b600060208284031215610dec57600080fd5b5035919050565b600060208284031215610e0557600080fd5b61056e82610d82565b60008060408385031215610e2157600080fd5b610e2a83610d82565b946020939093013593505050565b60008060408385031215610e4b57600080fd5b610e5483610d82565b9150610e6260208401610d82565b90509250929050565b600082610e8857634e487b7160e01b600052601260045260246000fd5b500490565b600060208284031215610e9f57600080fd5b5051919050565b80820281158282048414176105bd57634e487b7160e01b600052601160045260246000fd5b600060208284031215610edd57600080fd5b8151801515811461056e57600080fd5b6000825160005b81811015610f0e5760208186018101518583015201610ef4565b50600092019182525091905056fea26469706673582212203eec941eb7de5ec8236b95b04e1668c186e6d1a14509010914c131561ebbb2b464736f6c63430008140033
Loading...
Loading
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ 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.