Source Code
Overview
ETH Balance
More Info
ContractCreator
Multichain Info
N/A
Latest 8 from a total of 8 transactions
| Transaction Hash |
Method
|
Block
|
From
|
To
|
Amount
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Set Underlying P... | 10072894 | 345 days ago | IN | 0 ETH | 0.00000261 | ||||
| Set Price | 10072891 | 345 days ago | IN | 0 ETH | 0.00000259 | ||||
| Set Underlying P... | 10072574 | 345 days ago | IN | 0 ETH | 0.00000264 | ||||
| Set Price | 10072573 | 345 days ago | IN | 0 ETH | 0.00000263 | ||||
| Set Underlying P... | 9336193 | 363 days ago | IN | 0 ETH | 0.00000182 | ||||
| Set Price | 9336191 | 363 days ago | IN | 0 ETH | 0.00000182 | ||||
| Set Underlying P... | 9336125 | 363 days ago | IN | 0 ETH | 0.00000614 | ||||
| Set Price | 9336124 | 363 days ago | IN | 0 ETH | 0.00000614 |
Latest 25 internal transactions (View All)
| Parent Transaction Hash | Block | From | To | Amount | ||
|---|---|---|---|---|---|---|
| 24577194 | 20 hrs ago | 0 ETH | ||||
| 24577194 | 20 hrs ago | 0 ETH | ||||
| 24577194 | 20 hrs ago | 0 ETH | ||||
| 24577194 | 20 hrs ago | 0 ETH | ||||
| 24577194 | 20 hrs ago | 0 ETH | ||||
| 24577194 | 20 hrs ago | 0 ETH | ||||
| 24575222 | 21 hrs ago | 0 ETH | ||||
| 24575222 | 21 hrs ago | 0 ETH | ||||
| 24575222 | 21 hrs ago | 0 ETH | ||||
| 24372608 | 4 days ago | 0 ETH | ||||
| 24372608 | 4 days ago | 0 ETH | ||||
| 24372608 | 4 days ago | 0 ETH | ||||
| 24372567 | 4 days ago | 0 ETH | ||||
| 24372567 | 4 days ago | 0 ETH | ||||
| 24372567 | 4 days ago | 0 ETH | ||||
| 24322900 | 5 days ago | 0 ETH | ||||
| 24322900 | 5 days ago | 0 ETH | ||||
| 24322900 | 5 days ago | 0 ETH | ||||
| 24322878 | 5 days ago | 0 ETH | ||||
| 24322878 | 5 days ago | 0 ETH | ||||
| 24322878 | 5 days ago | 0 ETH | ||||
| 24322863 | 5 days ago | 0 ETH | ||||
| 24322863 | 5 days ago | 0 ETH | ||||
| 24322863 | 5 days ago | 0 ETH | ||||
| 24322836 | 5 days ago | 0 ETH |
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0xdf0bD507...CA952A826 The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
OracleMock
Compiler Version
v0.8.28+commit.7893614a
Optimization Enabled:
Yes with 2499 runs
Other Settings:
london EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: UNLICENSED
pragma solidity =0.8.28;
contract OracleMock {
uint256 public price;
uint256 public underlyingPrice;
address public admin;
mapping(address => uint8) public registeredDecimals;
error OracleMock_NotAuthorized();
constructor(address _admin) {
admin = _admin;
}
function setDecimals(address token, uint8 dec) external {
require(msg.sender == admin, OracleMock_NotAuthorized());
registeredDecimals[token] = dec;
}
function decimals() external pure returns (uint8) {
return 8;
}
function latestRoundData()
external
view
returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound)
{
roundId = 1;
answer = int256(price);
startedAt = block.timestamp;
updatedAt = block.timestamp;
answeredInRound = 1;
}
function latestAnswer() external view returns (int256) {
return int256(price);
}
function latestTimestamp() external view returns (uint256) {
return block.timestamp;
}
function setPrice(uint256 _price) external {
require(msg.sender == admin, OracleMock_NotAuthorized());
price = _price;
}
function setUnderlyingPrice(uint256 _price) external {
require(msg.sender == admin, OracleMock_NotAuthorized());
underlyingPrice = _price;
}
function getPrice(address) external view returns (uint256) {
return price;
}
function getUnderlyingPrice(address) external view returns (uint256) {
return underlyingPrice;
}
}{
"remappings": [
"@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
"@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
"risc0/=lib/risc0-ethereum/contracts/src/",
"forge-std/=lib/forge-std/src/",
"ds-test/=lib/openzeppelin-contracts/lib/forge-std/lib/ds-test/src/",
"erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
"openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
"openzeppelin-contracts/=lib/openzeppelin-contracts/",
"openzeppelin-foundry-upgrades/=lib/openzeppelin-foundry-upgrades/src/",
"risc0-ethereum/=lib/risc0-ethereum/",
"solidity-stringutils/=lib/openzeppelin-foundry-upgrades/lib/solidity-stringutils/"
],
"optimizer": {
"enabled": true,
"runs": 2499
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "ipfs",
"appendCBOR": true
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "london",
"viaIR": false,
"libraries": {}
}Contract ABI
API[{"inputs":[{"internalType":"address","name":"_admin","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"OracleMock_NotAuthorized","type":"error"},{"inputs":[],"name":"admin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"getPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"getUnderlyingPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"latestAnswer","outputs":[{"internalType":"int256","name":"","type":"int256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"latestRoundData","outputs":[{"internalType":"uint80","name":"roundId","type":"uint80"},{"internalType":"int256","name":"answer","type":"int256"},{"internalType":"uint256","name":"startedAt","type":"uint256"},{"internalType":"uint256","name":"updatedAt","type":"uint256"},{"internalType":"uint80","name":"answeredInRound","type":"uint80"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"latestTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"price","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"registeredDecimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint8","name":"dec","type":"uint8"}],"name":"setDecimals","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_price","type":"uint256"}],"name":"setPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_price","type":"uint256"}],"name":"setUnderlyingPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"underlyingPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]Contract Creation Code
0x6080604052348015600f57600080fd5b5060405161049a38038061049a833981016040819052602c916050565b600280546001600160a01b0319166001600160a01b0392909216919091179055607e565b600060208284031215606157600080fd5b81516001600160a01b0381168114607757600080fd5b9392505050565b61040d8061008d6000396000f3fe608060405234801561001057600080fd5b50600436106100df5760003560e01c806391b7f5ed1161008c578063f2259f9611610066578063f2259f961461018c578063f851a4401461019f578063fc57d4df146101e4578063feaf968c146101f957600080fd5b806391b7f5ed14610167578063a035b1fe1461017a578063efa32d491461018357600080fd5b806350d25bcd116100bd57806350d25bcd1461014457806357aefad21461014c5780638205bf6a1461016157600080fd5b8063313ce567146100e457806341976e09146100fe5780634201434814610121575b600080fd5b60085b60405160ff90911681526020015b60405180910390f35b61011361010c36600461035f565b5060005490565b6040519081526020016100f5565b6100e761012f36600461035f565b60036020526000908152604090205460ff1681565b600054610113565b61015f61015a366004610381565b61022c565b005b42610113565b61015f610175366004610381565b610269565b61011360005481565b61011360015481565b61015f61019a36600461039a565b6102a6565b6002546101bf9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100f5565b6101136101f236600461035f565b5060015490565b6000546040805160018082526020820193909352429181018290526060810191909152608081019190915260a0016100f5565b60025473ffffffffffffffffffffffffffffffffffffffff163314610264576040516356936a7b60e11b815260040160405180910390fd5b600155565b60025473ffffffffffffffffffffffffffffffffffffffff1633146102a1576040516356936a7b60e11b815260040160405180910390fd5b600055565b60025473ffffffffffffffffffffffffffffffffffffffff1633146102de576040516356936a7b60e11b815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff91909116600090815260036020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660ff909216919091179055565b803573ffffffffffffffffffffffffffffffffffffffff8116811461035a57600080fd5b919050565b60006020828403121561037157600080fd5b61037a82610336565b9392505050565b60006020828403121561039357600080fd5b5035919050565b600080604083850312156103ad57600080fd5b6103b683610336565b9150602083013560ff811681146103cc57600080fd5b80915050925092905056fea26469706673582212201e4a5e0e620ecb32137157b78184c3d139406cf02f90e9af5da6d651e4cc46fa64736f6c634300081c0033000000000000000000000000cde13ff278bc484a09adb69ea1eed3caf6ea4e00
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100df5760003560e01c806391b7f5ed1161008c578063f2259f9611610066578063f2259f961461018c578063f851a4401461019f578063fc57d4df146101e4578063feaf968c146101f957600080fd5b806391b7f5ed14610167578063a035b1fe1461017a578063efa32d491461018357600080fd5b806350d25bcd116100bd57806350d25bcd1461014457806357aefad21461014c5780638205bf6a1461016157600080fd5b8063313ce567146100e457806341976e09146100fe5780634201434814610121575b600080fd5b60085b60405160ff90911681526020015b60405180910390f35b61011361010c36600461035f565b5060005490565b6040519081526020016100f5565b6100e761012f36600461035f565b60036020526000908152604090205460ff1681565b600054610113565b61015f61015a366004610381565b61022c565b005b42610113565b61015f610175366004610381565b610269565b61011360005481565b61011360015481565b61015f61019a36600461039a565b6102a6565b6002546101bf9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100f5565b6101136101f236600461035f565b5060015490565b6000546040805160018082526020820193909352429181018290526060810191909152608081019190915260a0016100f5565b60025473ffffffffffffffffffffffffffffffffffffffff163314610264576040516356936a7b60e11b815260040160405180910390fd5b600155565b60025473ffffffffffffffffffffffffffffffffffffffff1633146102a1576040516356936a7b60e11b815260040160405180910390fd5b600055565b60025473ffffffffffffffffffffffffffffffffffffffff1633146102de576040516356936a7b60e11b815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff91909116600090815260036020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660ff909216919091179055565b803573ffffffffffffffffffffffffffffffffffffffff8116811461035a57600080fd5b919050565b60006020828403121561037157600080fd5b61037a82610336565b9392505050565b60006020828403121561039357600080fd5b5035919050565b600080604083850312156103ad57600080fd5b6103b683610336565b9150602083013560ff811681146103cc57600080fd5b80915050925092905056fea26469706673582212201e4a5e0e620ecb32137157b78184c3d139406cf02f90e9af5da6d651e4cc46fa64736f6c634300081c0033
Loading...
Loading
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.