Source Code
Overview
ETH Balance
0 ETH
Token Holdings
More Info
ContractCreator
Multichain Info
N/A
Latest 1 from a total of 1 transactions
| Transaction Hash |
Method
|
Block
|
From
|
To
|
Amount
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Set Fee Token | 11126770 | 656 days ago | IN | 0 ETH | 0.001368572274 |
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0xd2F16063...DfAd935ac The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
MockStakingThales
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 "../../interfaces/ISportsAMMV2Manager.sol";
contract MockStakingThales {
mapping(address => uint) public volume;
address public feeToken;
function updateVolume(address account, uint amount) public {
uint decimals = ISportsAMMV2Manager(feeToken).decimals();
if (amount == 0) {
require(amount > 0, "zero amount received");
} else if (decimals == 6) {
require(amount / 1e6 > 0, "Did not receive 6 decimals update volume");
} else if (decimals == 18) {
require(amount / 1e18 > 0, "Did not receive 18 decimals update volume");
} else {
require(amount > 0, "zero amount received");
}
volume[account] = amount;
}
function updateVolumeAtAmountDecimals(address account, uint amount, uint decimals) external {
uint actualAmount = amount;
uint stakingCollateralDecimals = getFeeTokenDecimals();
if (decimals < stakingCollateralDecimals) {
actualAmount = amount * 10 ** (18 - decimals);
} else if (decimals > stakingCollateralDecimals) {
actualAmount = amount / 10 ** (18 - stakingCollateralDecimals);
}
updateVolume(account, actualAmount);
}
function getFeeTokenDecimals() public view returns (uint feeTokenDecimals) {
feeTokenDecimals = ISportsAMMV2Manager(feeToken).decimals();
}
function setFeeToken(address _feeToken) external {
feeToken = _feeToken;
}
}// 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
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;
}
struct TradeParams {
uint _buyInAmount;
uint _expectedPayout;
uint _additionalSlippage;
address _differentRecipient;
address _collateral;
address _collateralPool;
uint _collateralPriceInUSD;
}
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,
address _requester,
uint _buyInAmount,
uint _expectedPayout,
address _differentRecipient,
address _referrer,
address _collateral
) external returns (address _createdTicket);
function trade(
TradeData[] calldata _tradeData,
uint _buyInAmount,
uint _expectedPayout,
uint _additionalSlippage,
address _differentRecipient,
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;
}{
"optimizer": {
"enabled": true,
"runs": 200
},
"evmVersion": "paris",
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}Contract ABI
API[{"inputs":[],"name":"feeToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getFeeTokenDecimals","outputs":[{"internalType":"uint256","name":"feeTokenDecimals","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_feeToken","type":"address"}],"name":"setFeeToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"updateVolume","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"decimals","type":"uint256"}],"name":"updateVolumeAtAmountDecimals","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"volume","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]Contract Creation Code
0x608060405234801561001057600080fd5b5061066f806100206000396000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c806302c7739b1461006757806315cce2241461007c578063647846a5146100ac57806365550ef8146100dc578063a2dd835f146100f2578063adeabba914610105575b600080fd5b61007a610075366004610449565b610125565b005b61007a61008a366004610473565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6001546100bf906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6100e4610342565b6040519081526020016100d3565b61007a610100366004610495565b6103b5565b6100e4610113366004610473565b60006020819052908152604090205481565b6001546040805163313ce56760e01b815290516000926001600160a01b03169163313ce5679160048083019260209291908290030181865afa15801561016f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061019391906104c8565b9050816000036101ee57600082116101e95760405162461bcd60e51b81526020600482015260146024820152731e995c9bc8185b5bdd5b9d081c9958d95a5d995960621b60448201526064015b60405180910390fd5b610325565b80600603610263576000610205620f4240846104f7565b116101e95760405162461bcd60e51b815260206004820152602860248201527f446964206e6f742072656365697665203620646563696d616c732075706461746044820152676520766f6c756d6560c01b60648201526084016101e0565b806012036102de57600061027f670de0b6b3a7640000846104f7565b116101e95760405162461bcd60e51b815260206004820152602960248201527f446964206e6f74207265636569766520313820646563696d616c732075706461604482015268746520766f6c756d6560b81b60648201526084016101e0565b600082116103255760405162461bcd60e51b81526020600482015260146024820152731e995c9bc8185b5bdd5b9d081c9958d95a5d995960621b60448201526064016101e0565b506001600160a01b03909116600090815260208190526040902055565b6001546040805163313ce56760e01b815290516000926001600160a01b03169163313ce5679160048083019260209291908290030181865afa15801561038c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103b091906104c8565b905090565b8160006103c0610342565b9050808310156103f1576103d5836012610519565b6103e090600a610616565b6103ea9085610622565b915061041c565b8083111561041c57610404816012610519565b61040f90600a610616565b61041990856104f7565b91505b6104268583610125565b5050505050565b80356001600160a01b038116811461044457600080fd5b919050565b6000806040838503121561045c57600080fd5b6104658361042d565b946020939093013593505050565b60006020828403121561048557600080fd5b61048e8261042d565b9392505050565b6000806000606084860312156104aa57600080fd5b6104b38461042d565b95602085013595506040909401359392505050565b6000602082840312156104da57600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b60008261051457634e487b7160e01b600052601260045260246000fd5b500490565b8181038181111561052c5761052c6104e1565b92915050565b600181815b8085111561056d578160001904821115610553576105536104e1565b8085161561056057918102915b93841c9390800290610537565b509250929050565b6000826105845750600161052c565b816105915750600061052c565b81600181146105a757600281146105b1576105cd565b600191505061052c565b60ff8411156105c2576105c26104e1565b50506001821b61052c565b5060208310610133831016604e8410600b84101617156105f0575081810a61052c565b6105fa8383610532565b806000190482111561060e5761060e6104e1565b029392505050565b600061048e8383610575565b808202811582820484141761052c5761052c6104e156fea2646970667358221220dbb4df64d1620237f44f8bdcc6ea0a8f42f39e62500af45b7e57be68e580165c64736f6c63430008140033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100625760003560e01c806302c7739b1461006757806315cce2241461007c578063647846a5146100ac57806365550ef8146100dc578063a2dd835f146100f2578063adeabba914610105575b600080fd5b61007a610075366004610449565b610125565b005b61007a61008a366004610473565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6001546100bf906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6100e4610342565b6040519081526020016100d3565b61007a610100366004610495565b6103b5565b6100e4610113366004610473565b60006020819052908152604090205481565b6001546040805163313ce56760e01b815290516000926001600160a01b03169163313ce5679160048083019260209291908290030181865afa15801561016f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061019391906104c8565b9050816000036101ee57600082116101e95760405162461bcd60e51b81526020600482015260146024820152731e995c9bc8185b5bdd5b9d081c9958d95a5d995960621b60448201526064015b60405180910390fd5b610325565b80600603610263576000610205620f4240846104f7565b116101e95760405162461bcd60e51b815260206004820152602860248201527f446964206e6f742072656365697665203620646563696d616c732075706461746044820152676520766f6c756d6560c01b60648201526084016101e0565b806012036102de57600061027f670de0b6b3a7640000846104f7565b116101e95760405162461bcd60e51b815260206004820152602960248201527f446964206e6f74207265636569766520313820646563696d616c732075706461604482015268746520766f6c756d6560b81b60648201526084016101e0565b600082116103255760405162461bcd60e51b81526020600482015260146024820152731e995c9bc8185b5bdd5b9d081c9958d95a5d995960621b60448201526064016101e0565b506001600160a01b03909116600090815260208190526040902055565b6001546040805163313ce56760e01b815290516000926001600160a01b03169163313ce5679160048083019260209291908290030181865afa15801561038c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103b091906104c8565b905090565b8160006103c0610342565b9050808310156103f1576103d5836012610519565b6103e090600a610616565b6103ea9085610622565b915061041c565b8083111561041c57610404816012610519565b61040f90600a610616565b61041990856104f7565b91505b6104268583610125565b5050505050565b80356001600160a01b038116811461044457600080fd5b919050565b6000806040838503121561045c57600080fd5b6104658361042d565b946020939093013593505050565b60006020828403121561048557600080fd5b61048e8261042d565b9392505050565b6000806000606084860312156104aa57600080fd5b6104b38461042d565b95602085013595506040909401359392505050565b6000602082840312156104da57600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b60008261051457634e487b7160e01b600052601260045260246000fd5b500490565b8181038181111561052c5761052c6104e1565b92915050565b600181815b8085111561056d578160001904821115610553576105536104e1565b8085161561056057918102915b93841c9390800290610537565b509250929050565b6000826105845750600161052c565b816105915750600061052c565b81600181146105a757600281146105b1576105cd565b600191505061052c565b60ff8411156105c2576105c26104e1565b50506001821b61052c565b5060208310610133831016604e8410600b84101617156105f0575081810a61052c565b6105fa8383610532565b806000190482111561060e5761060e6104e1565b029392505050565b600061048e8383610575565b808202811582820484141761052c5761052c6104e156fea2646970667358221220dbb4df64d1620237f44f8bdcc6ea0a8f42f39e62500af45b7e57be68e580165c64736f6c63430008140033
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.