Source Code
| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Cross-Chain Transactions
Loading...
Loading
Contract Name:
Api3AggregatorAdaptor
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;
import "./interfaces/IProxy.sol";
contract Api3AggregatorAdaptor {
// Updating the proxy address is a security-critical action which is why
// we have made it immutable.
address public immutable proxy;
constructor(address _proxy) {
proxy = _proxy;
}
function latestAnswer() external view returns (int256 value) {
(int256 rawValue, ) = readDataFeed();
value = rawValue / 1e10;
}
function latestTimestamp() external view returns (uint256 timestamp) {
( , timestamp) = readDataFeed();
}
function decimals() external view returns (uint8) {
return 8;
}
function readDataFeed()
internal
view
returns (int224 value, uint256 timestamp)
{
(value, timestamp) = IProxy(proxy).read();
// If you have any assumptions about `value` and `timestamp`, make sure
// to validate them right after reading from the proxy. For example,
// if the value you are reading is the spot price of an asset, you may
// want to reject non-positive values...
// require(value > 0, "Value not positive");
// ...and if the data feed is being updated with a one day-heartbeat
// interval, you may want to check for that.
// require(
// timestamp + 1 days > block.timestamp,
// "Timestamp older than one day"
// );
// Try to be strict about validations, but be wary of:
// (1) Overly strict validation that may invalidate valid values
// (2) Mutable validation parameters that are controlled by a trusted
// party (eliminates the trust-minimization guarantees of first-party
// oracles)
// (3) Validation parameters that need to be tuned according to
// external conditions (if these are forgotten to be handled, it will
// result in (1), look up the Venus Protocol exploit related to LUNA)
// After validation, you can implement your contract logic here.
}
function getTokenType() external pure returns (uint256) {
return 1;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/// @dev See DapiProxy.sol for comments about usage
interface IProxy {
function read() external view returns (int224 value, uint32 timestamp);
function api3ServerV1() external view returns (address);
}{
"optimizer": {
"enabled": true,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_proxy","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTokenType","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"latestAnswer","outputs":[{"internalType":"int256","name":"value","type":"int256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"latestTimestamp","outputs":[{"internalType":"uint256","name":"timestamp","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proxy","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]Contract Creation Code
60a060405234801561001057600080fd5b506040516102f83803806102f883398101604081905261002f91610040565b6001600160a01b0316608052610070565b60006020828403121561005257600080fd5b81516001600160a01b038116811461006957600080fd5b9392505050565b608051610267610091600039600081816093015261010f01526102676000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c8063313ce5671461005c57806350d25bcd146100705780638205bf6a14610086578063ec5568891461008e578063fcab1819146100cd575b600080fd5b604051600881526020015b60405180910390f35b6100786100d4565b604051908152602001610067565b6100786100fa565b6100b57f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610067565b6001610078565b6000806100df61010a565b50601b0b90506100f46402540be4008261019e565b91505090565b600061010461010a565b92915050565b6000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166357de26a46040518163ffffffff1660e01b81526004016040805180830381865afa15801561016a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061018e91906101e8565b909363ffffffff90911692509050565b6000826101bb57634e487b7160e01b600052601260045260246000fd5b600160ff1b8214600019841416156101e357634e487b7160e01b600052601160045260246000fd5b500590565b600080604083850312156101fb57600080fd5b825180601b0b811461020c57600080fd5b602084015190925063ffffffff8116811461022657600080fd5b80915050925092905056fea2646970667358221220b0bc7c40681dd0d59b5a548ef91f1bcb6e8811db8cb8962d2ef0bd4d422c36d164736f6c63430008110033000000000000000000000000b8f66692a0ead7403b77d4e74d7a27789577a199
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100575760003560e01c8063313ce5671461005c57806350d25bcd146100705780638205bf6a14610086578063ec5568891461008e578063fcab1819146100cd575b600080fd5b604051600881526020015b60405180910390f35b6100786100d4565b604051908152602001610067565b6100786100fa565b6100b57f000000000000000000000000b8f66692a0ead7403b77d4e74d7a27789577a19981565b6040516001600160a01b039091168152602001610067565b6001610078565b6000806100df61010a565b50601b0b90506100f46402540be4008261019e565b91505090565b600061010461010a565b92915050565b6000807f000000000000000000000000b8f66692a0ead7403b77d4e74d7a27789577a1996001600160a01b03166357de26a46040518163ffffffff1660e01b81526004016040805180830381865afa15801561016a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061018e91906101e8565b909363ffffffff90911692509050565b6000826101bb57634e487b7160e01b600052601260045260246000fd5b600160ff1b8214600019841416156101e357634e487b7160e01b600052601160045260246000fd5b500590565b600080604083850312156101fb57600080fd5b825180601b0b811461020c57600080fd5b602084015190925063ffffffff8116811461022657600080fd5b80915050925092905056fea2646970667358221220b0bc7c40681dd0d59b5a548ef91f1bcb6e8811db8cb8962d2ef0bd4d422c36d164736f6c63430008110033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000b8f66692a0ead7403b77d4e74d7a27789577a199
-----Decoded View---------------
Arg [0] : _proxy (address): 0xB8f66692a0EaD7403B77d4e74d7a27789577a199
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000b8f66692a0ead7403b77d4e74d7a27789577a199
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in FRAX
0
Multichain Portfolio | 35 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.