Overview
S Balance
0 S
S Value
-More Info
Private Name Tags
ContractCreator
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
AggregatorAdapter
Compiler Version
v0.8.26+commit.8a97fa7a
Optimization Enabled:
Yes with 200 runs
Other Settings:
cancun EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.26; import {IAggregatorInterfaceMinimal} from "./interfaces/IAggregatorInterfaceMinimal.sol"; /// @title Adapter that normalize decimals for Chainlink-compatible aggregators /// @author Alien Deployer (https://github.com/a17) contract AggregatorAdapter is IAggregatorInterfaceMinimal { uint8 internal constant _DECIMALS = 8; address public immutable source; uint8 internal immutable sourceDecimals; constructor(address source_) { source = source_; sourceDecimals = IAggregatorInterfaceMinimal(source_).decimals(); } /// @inheritdoc IAggregatorInterfaceMinimal function decimals() external pure returns (uint8) { return _DECIMALS; } /// @inheritdoc IAggregatorInterfaceMinimal function latestAnswer() external view returns (int) { IAggregatorInterfaceMinimal _source = IAggregatorInterfaceMinimal(source); // assume that source cant have less decimals than _DECIMALS int divider = int(10 ** (sourceDecimals - _DECIMALS)); return _source.latestAnswer() / divider; } /// @inheritdoc IAggregatorInterfaceMinimal function latestTimestamp() external view returns (uint) { return IAggregatorInterfaceMinimal(source).latestTimestamp(); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.26; interface IAggregatorInterfaceMinimal { /// @notice represents the number of decimals the aggregator responses represent function decimals() external view returns (uint8); /// @notice Reads the current answer from aggregator delegated to function latestAnswer() external view returns (int); /// @notice Get the latest completed round where the answer was updated function latestTimestamp() external view returns (uint); }
{ "remappings": [ "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/", "ds-test/=lib/openzeppelin-contracts/lib/forge-std/lib/ds-test/src/", "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/", "forge-std/=lib/forge-std/src/", "halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/", "openzeppelin-contracts/=lib/openzeppelin-contracts/" ], "optimizer": { "enabled": true, "runs": 200 }, "metadata": { "useLiteralContent": false, "bytecodeHash": "ipfs", "appendCBOR": true }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "cancun", "viaIR": false, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"source_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"latestAnswer","outputs":[{"internalType":"int256","name":"","type":"int256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"latestTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"source","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
60c060405234801561000f575f80fd5b506040516104e13803806104e183398101604081905261002e916100a6565b6001600160a01b03811660808190526040805163313ce56760e01b8152905163313ce567916004808201926020929091908290030181865afa158015610076573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061009a91906100d3565b60ff1660a052506100f3565b5f602082840312156100b6575f80fd5b81516001600160a01b03811681146100cc575f80fd5b9392505050565b5f602082840312156100e3575f80fd5b815160ff811681146100cc575f80fd5b60805160a0516103c261011f5f395f60e901525f8181607d0152818160c2015261018f01526103c25ff3fe608060405234801561000f575f80fd5b506004361061004a575f3560e01c8063313ce5671461004e57806350d25bcd1461006257806367e828bf146100785780638205bf6a146100b7575b5f80fd5b604051600881526020015b60405180910390f35b61006a6100bf565b604051908152602001610059565b61009f7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610059565b61006a61018c565b5f7f00000000000000000000000000000000000000000000000000000000000000008161010d60087f0000000000000000000000000000000000000000000000000000000000000000610226565b61011890600a610328565b905080826001600160a01b03166350d25bcd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610157573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061017b919061033d565b6101859190610354565b9250505090565b5f7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316638205bf6a6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156101e9573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061020d919061033d565b905090565b634e487b7160e01b5f52601160045260245ffd5b60ff828116828216039081111561023f5761023f610212565b92915050565b6001815b60018411156102805780850481111561026457610264610212565b600184161561027257908102905b60019390931c928002610249565b935093915050565b5f826102965750600161023f565b816102a257505f61023f565b81600181146102b857600281146102c2576102de565b600191505061023f565b60ff8411156102d3576102d3610212565b50506001821b61023f565b5060208310610133831016604e8410600b8410161715610301575081810a61023f565b61030d5f198484610245565b805f190482111561032057610320610212565b029392505050565b5f61033660ff841683610288565b9392505050565b5f6020828403121561034d575f80fd5b5051919050565b5f8261036e57634e487b7160e01b5f52601260045260245ffd5b600160ff1b82145f198414161561038757610387610212565b50059056fea2646970667358221220e2622e1dc724beec579c9cdcaccb8b3941f942026b893e34c97e4ca0e9464de364736f6c634300081a00330000000000000000000000008927da1377c78d25e78c335f48a6f8e42cce0c09
Deployed Bytecode
0x608060405234801561000f575f80fd5b506004361061004a575f3560e01c8063313ce5671461004e57806350d25bcd1461006257806367e828bf146100785780638205bf6a146100b7575b5f80fd5b604051600881526020015b60405180910390f35b61006a6100bf565b604051908152602001610059565b61009f7f0000000000000000000000008927da1377c78d25e78c335f48a6f8e42cce0c0981565b6040516001600160a01b039091168152602001610059565b61006a61018c565b5f7f0000000000000000000000008927da1377c78d25e78c335f48a6f8e42cce0c098161010d60087f0000000000000000000000000000000000000000000000000000000000000012610226565b61011890600a610328565b905080826001600160a01b03166350d25bcd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610157573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061017b919061033d565b6101859190610354565b9250505090565b5f7f0000000000000000000000008927da1377c78d25e78c335f48a6f8e42cce0c096001600160a01b0316638205bf6a6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156101e9573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061020d919061033d565b905090565b634e487b7160e01b5f52601160045260245ffd5b60ff828116828216039081111561023f5761023f610212565b92915050565b6001815b60018411156102805780850481111561026457610264610212565b600184161561027257908102905b60019390931c928002610249565b935093915050565b5f826102965750600161023f565b816102a257505f61023f565b81600181146102b857600281146102c2576102de565b600191505061023f565b60ff8411156102d3576102d3610212565b50506001821b61023f565b5060208310610133831016604e8410600b8410161715610301575081810a61023f565b61030d5f198484610245565b805f190482111561032057610320610212565b029392505050565b5f61033660ff841683610288565b9392505050565b5f6020828403121561034d575f80fd5b5051919050565b5f8261036e57634e487b7160e01b5f52601260045260245ffd5b600160ff1b82145f198414161561038757610387610212565b50059056fea2646970667358221220e2622e1dc724beec579c9cdcaccb8b3941f942026b893e34c97e4ca0e9464de364736f6c634300081a0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000008927da1377c78d25e78c335f48a6f8e42cce0c09
-----Decoded View---------------
Arg [0] : source_ (address): 0x8927DA1377C78D25E78c335F48a6f8e42Cce0C09
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000008927da1377c78d25e78c335f48a6f8e42cce0c09
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.