Address Contract Verified
Address
0x7F36E7F562Ee3f320644F6031e03E12a02B85799
Balance
0.015129 ETH
Nonce
1
Code Size
2549 bytes
Creator
0xd1236a6A...3Fbd at tx 0xcbc7e289...4a731e
Indexed Transactions
0
Contract Bytecode
2549 bytes
0x60806040526004361061007b5760003560e01c806395550b551161004e57806395550b55146101e35780639b5f694a1461021e578063cdcc387714610252578063ead05e681461027557600080fd5b80631e1fd291146100805780634ba2363a146101355780634d1374a51461018e5780636d7bfdbf146101a3575b600080fd5b34801561008c57600080fd5b506000546100ef906bffffffffffffffffffffffff8116906c0100000000000000000000000081046effffffffffffffffffffffffffffff16907b01000000000000000000000000000000000000000000000000000000900464ffffffffff1683565b604080516bffffffffffffffffffffffff90941684526effffffffffffffffffffffffffffff909216602084015264ffffffffff16908201526060015b60405180910390f35b34801561014157600080fd5b506101697f000000000000000000000000197e90f9fad81970ba7976f33cbd77088e5d7cf781565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161012c565b6101a161019c366004610857565b61035f565b005b3480156101af57600080fd5b506000546c0100000000000000000000000090046effffffffffffffffffffffffffffff165b60405190815260200161012c565b3480156101ef57600080fd5b506000547b01000000000000000000000000000000000000000000000000000000900464ffffffffff166101d5565b34801561022a57600080fd5b506101697f000000000000000000000000ca61540ec2ac74e6954fa558b4af836d95ecb91b81565b34801561025e57600080fd5b506000546bffffffffffffffffffffffff166101d5565b34801561028157600080fd5b50610317604080516060810182526000808252602082018190529181019190915250604080516060810182526000546bffffffffffffffffffffffff811682526c0100000000000000000000000081046effffffffffffffffffffffffffffff1660208301527b01000000000000000000000000000000000000000000000000000000900464ffffffffff169181019190915290565b6040805182516bffffffffffffffffffffffff1681526020808401516effffffffffffffffffffffffffffff16908201529181015164ffffffffff169082015260600161012c565b6103937f000000000000000000000000ca61540ec2ac74e6954fa558b4af836d95ecb91b61038b610398565b8585856106dc565b505050565b6060600060405180606001604052807f000000000000000000000000197e90f9fad81970ba7976f33cbd77088e5d7cf773ffffffffffffffffffffffffffffffffffffffff1663487bf0826040518163ffffffff1660e01b8152600401602060405180830381865afa158015610412573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104369190610883565b6bffffffffffffffffffffffff1681526020017f000000000000000000000000197e90f9fad81970ba7976f33cbd77088e5d7cf773ffffffffffffffffffffffffffffffffffffffff1663c92aecc46040518163ffffffff1660e01b8152600401602060405180830381865afa1580156104b4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104d89190610883565b6effffffffffffffffffffffffffffff1681526020017f000000000000000000000000197e90f9fad81970ba7976f33cbd77088e5d7cf773ffffffffffffffffffffffffffffffffffffffff166320aba08b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610559573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061057d9190610883565b64ffffffffff908116909152815160008054602085018051604080880180516bffffffffffffffffffffffff9097167fffffffffff00000000000000000000000000000000000000000000000000000090951685176c010000000000000000000000006effffffffffffffffffffffffffffff94851602177affffffffffffffffffffffffffffffffffffffffffffffffffffff167b0100000000000000000000000000000000000000000000000000000097891697909702969096179094559251602481019290925251909116604482015290519091166064820152909150608401604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f58aff2ef0000000000000000000000000000000000000000000000000000000017905292915050565b6106fe734dbd4fc535ac27206064b68ffcf827b0a60bab3f8686868686610705565b5050505050565b83516040517fa66b327d00000000000000000000000000000000000000000000000000000000815260009173ffffffffffffffffffffffffffffffffffffffff89169163a66b327d91610765918690600401918252602082015260400190565b602060405180830381865afa158015610782573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107a69190610883565b905060006107b484866108cb565b905073ffffffffffffffffffffffffffffffffffffffff881663679b6ded6107dc83856108e8565b896000866000808c8c8f6040518a63ffffffff1660e01b81526004016108099897969594939291906108fb565b60206040518083038185885af1158015610827573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061084c9190610883565b505050505050505050565b60008060006060848603121561086c57600080fd5b505081359360208301359350604090920135919050565b60006020828403121561089557600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b80820281158282048414176108e2576108e261089c565b92915050565b808201808211156108e2576108e261089c565b600061010073ffffffffffffffffffffffffffffffffffffffff808c16845260208b818601528a6040860152818a16606086015281891660808601528760a08601528660c08601528260e0860152855191508183860152600092505b8183101561097657858301810151858401610120015291820191610957565b5061012091506000828286010152817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010192505050999850505050505050505056fea26469706673582212202696a1c8393d870c9021f201018e57d61d29b96b39d262997a2bdd4c9e3be56e64736f6c63430008140033
Verified Source Code Full Match
Compiler: v0.8.20+commit.a1b79de6
EVM: paris
Optimization: Yes (100000 runs)
IPot.sol 8 lines
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity >=0.8.0;
interface IPot {
function dsr() external view returns (uint256);
function chi() external view returns (uint256);
function rho() external view returns (uint256);
}
IDSROracle.sol 94 lines
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity >=0.8.0;
/**
* @title IDSROracle
* @notice Consolidated DSR reporting along with some convenience functions.
*/
interface IDSROracle {
struct PotData {
uint96 dsr; // Dai Savings Rate in per-second value [ray]
uint120 chi; // Last computed conversion rate [ray]
uint40 rho; // Last computed timestamp [seconds]
}
/**
* @notice Emitted when the PotData is updated.
* @param nextData The new PotData struct.
*/
event SetPotData(PotData nextData);
/**
* @notice Retrieve the current PotData: dsr, chi, and rho.
* @return The current PotData struct.
*/
function getPotData() external view returns (PotData memory);
/**
* @notice Get the current Dai Savings Rate.
* @return The Dai Savings Rate in per-second value [ray].
*/
function getDSR() external view returns (uint256);
/**
* @notice Get the last computed conversion rate.
* @return The last computed conversion rate [ray].
*/
function getChi() external view returns (uint256);
/**
* @notice Get the last computed timestamp.
* @return The last computed timestamp [seconds].
*/
function getRho() external view returns (uint256);
/**
* @notice Get the Annual Percentage Rate.
* @return The APR.
*/
function getAPR() external view returns (uint256);
/**
* @notice Get the conversion rate at the current timestamp.
* @return The conversion rate.
*/
function getConversionRate() external view returns (uint256);
/**
* @notice Get the conversion rate at a specified timestamp.
* @dev Timestamp must be greater than or equal to the current timestamp.
* @param timestamp The timestamp at which to retrieve the conversion rate.
* @return The conversion rate.
*/
function getConversionRate(uint256 timestamp) external view returns (uint256);
/**
* @notice Get the binomial approximated conversion rate at the current timestamp.
* @return The binomial approximated conversion rate.
*/
function getConversionRateBinomialApprox() external view returns (uint256);
/**
* @notice Get the binomial approximated conversion rate at a specified timestamp.
* @dev Timestamp must be greater than or equal to the current timestamp.
* @param timestamp The timestamp at which to retrieve the binomial approximated conversion rate.
* @return The binomial approximated conversion rate.
*/
function getConversionRateBinomialApprox(uint256 timestamp) external view returns (uint256);
/**
* @notice Get the linear approximated conversion rate at the current timestamp.
* @return The linear approximated conversion rate.
*/
function getConversionRateLinearApprox() external view returns (uint256);
/**
* @notice Get the linear approximated conversion rate at a specified timestamp.
* @dev Timestamp must be greater than or equal to the current timestamp.
* @param timestamp The timestamp at which to retrieve the linear approximated conversion rate.
* @return The linear approximated conversion rate.
*/
function getConversionRateLinearApprox(uint256 timestamp) external view returns (uint256);
}
IDSRAuthOracle.sol 41 lines
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity >=0.8.0;
import { IDSROracle } from './IDSROracle.sol';
/**
* @title IDSRAuthOracle
* @notice Consolidated DSR reporting along with some convenience functions.
*/
interface IDSRAuthOracle is IDSROracle {
/**
* @notice Emitted when the maxDSR is updated.
*/
event SetMaxDSR(uint256 maxDSR);
/**
* @notice The data provider role.
*/
function DATA_PROVIDER_ROLE() external view returns (bytes32);
/**
* @notice Get the max dsr.
*/
function maxDSR() external view returns (uint256);
/**
* @notice Set the max dsr.
* @param maxDSR The max dsr.
* @dev Only callable by the admin role.
*/
function setMaxDSR(uint256 maxDSR) external;
/**
* @notice Update the pot data.
* @param data The max dsr.
* @dev Only callable by the data provider role.
*/
function setPotData(IDSROracle.PotData calldata data) external;
}
DSROracleForwarderBase.sol 52 lines
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity ^0.8.0;
import { IDSRAuthOracle, IDSROracle } from '../interfaces/IDSRAuthOracle.sol';
import { IPot } from '../interfaces/IPot.sol';
/**
* @title DSROracleForwarderBase
* @notice Base contract for relaying pot data messages cross-chain.
*/
abstract contract DSROracleForwarderBase {
IPot public immutable pot;
address public immutable l2Oracle;
IDSROracle.PotData public _lastSeenPotData;
constructor(address _pot, address _l2Oracle) {
pot = IPot(_pot);
l2Oracle = _l2Oracle;
}
function _packMessage() internal returns (bytes memory) {
IDSROracle.PotData memory potData = IDSROracle.PotData({
dsr: uint96(pot.dsr()),
chi: uint120(pot.chi()),
rho: uint40(pot.rho())
});
_lastSeenPotData = potData;
return abi.encodeCall(
IDSRAuthOracle.setPotData,
(potData)
);
}
function getLastSeenPotData() external view returns (IDSROracle.PotData memory) {
return _lastSeenPotData;
}
function getLastSeenDSR() external view returns (uint256) {
return _lastSeenPotData.dsr;
}
function getLastSeenChi() external view returns (uint256) {
return _lastSeenPotData.chi;
}
function getLastSeenRho() external view returns (uint256) {
return _lastSeenPotData.rho;
}
}
XChainForwarders.sol 199 lines
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity ^0.8.0;
interface ICrossDomainOptimism {
function sendMessage(address _target, bytes calldata _message, uint32 _gasLimit) external;
}
interface ICrossDomainArbitrum {
function createRetryableTicket(
address to,
uint256 l2CallValue,
uint256 maxSubmissionCost,
address excessFeeRefundAddress,
address callValueRefundAddress,
uint256 gasLimit,
uint256 maxFeePerGas,
bytes calldata data
) external payable returns (uint256);
function calculateRetryableSubmissionFee(uint256 dataLength, uint256 baseFee) external view returns (uint256);
}
interface ICrossDomainGnosis {
function requireToPassMessage(address _contract, bytes memory _data, uint256 _gas) external returns (bytes32);
}
interface ICrossDomainZkEVM {
function bridgeMessage(
uint32 destinationNetwork,
address destinationAddress,
bool forceUpdateGlobalExitRoot,
bytes calldata metadata
) external payable;
}
/**
* @title XChainForwarders
* @notice Helper functions to abstract over L1 -> L2 message passing.
* @dev General structure is sendMessageXXX(target, message, gasLimit) where XXX is the remote domain name (IE OptimismMainnet, ArbitrumOne, Base, etc).
*/
library XChainForwarders {
/// ================================ Optimism Style ================================
function sendMessageOptimism(
address l1CrossDomain,
address target,
bytes memory message,
uint256 gasLimit
) internal {
ICrossDomainOptimism(l1CrossDomain).sendMessage(
target,
message,
uint32(gasLimit)
);
}
function sendMessageOptimismMainnet(
address target,
bytes memory message,
uint256 gasLimit
) internal {
sendMessageOptimism(
0x25ace71c97B33Cc4729CF772ae268934F7ab5fA1,
target,
message,
uint32(gasLimit)
);
}
function sendMessageBase(
address target,
bytes memory message,
uint256 gasLimit
) internal {
sendMessageOptimism(
0x866E82a600A1414e583f7F13623F1aC5d58b0Afa,
target,
message,
uint32(gasLimit)
);
}
/// ================================ Arbitrum Style ================================
function sendMessageArbitrum(
address l1CrossDomain,
address target,
bytes memory message,
uint256 gasLimit,
uint256 maxFeePerGas,
uint256 baseFee
) internal {
uint256 maxSubmission = ICrossDomainArbitrum(l1CrossDomain).calculateRetryableSubmissionFee(message.length, baseFee);
uint256 maxRedemption = gasLimit * maxFeePerGas;
ICrossDomainArbitrum(l1CrossDomain).createRetryableTicket{value: maxSubmission + maxRedemption}(
target,
0, // we always assume that l2CallValue = 0
maxSubmission,
address(0), // burn the excess gas
address(0), // burn the excess gas
gasLimit,
maxFeePerGas,
message
);
}
function sendMessageArbitrumOne(
address target,
bytes memory message,
uint256 gasLimit,
uint256 maxFeePerGas,
uint256 baseFee
) internal {
sendMessageArbitrum(
0x4Dbd4fc535Ac27206064B68FfCf827b0A60BAB3f,
target,
message,
gasLimit,
maxFeePerGas,
baseFee
);
}
function sendMessageArbitrumNova(
address target,
bytes memory message,
uint256 gasLimit,
uint256 maxFeePerGas,
uint256 baseFee
) internal {
sendMessageArbitrum(
0xc4448b71118c9071Bcb9734A0EAc55D18A153949,
target,
message,
gasLimit,
maxFeePerGas,
baseFee
);
}
/// ================================ Gnosis ================================
function sendMessageGnosis(
address l1CrossDomain,
address target,
bytes memory message,
uint256 gasLimit
) internal {
ICrossDomainGnosis(l1CrossDomain).requireToPassMessage(
target,
message,
gasLimit
);
}
function sendMessageGnosis(
address target,
bytes memory message,
uint256 gasLimit
) internal {
sendMessageGnosis(
0x4C36d2919e407f0Cc2Ee3c993ccF8ac26d9CE64e,
target,
message,
gasLimit
);
}
/// ================================ zkEVM ================================
function sendMessageZkEVM(
address l1CrossDomain,
uint32 destinationNetworkId,
address destinationAddress,
bool forceUpdateGlobalExitRoot,
bytes memory metadata
) internal {
ICrossDomainZkEVM(l1CrossDomain).bridgeMessage(
destinationNetworkId,
destinationAddress,
forceUpdateGlobalExitRoot,
metadata
);
}
function sendMessageZkEVM(
address destinationAddress,
bytes memory metadata
) internal {
sendMessageZkEVM(
0x2a3DD3EB832aF982ec71669E178424b10Dca2EDe,
1,
destinationAddress,
true,
metadata
);
}
}
DSROracleForwarderArbitrumOne.sol 28 lines
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity ^0.8.0;
import { XChainForwarders } from 'xchain-helpers/XChainForwarders.sol';
import { DSROracleForwarderBase } from './DSROracleForwarderBase.sol';
contract DSROracleForwarderArbitrumOne is DSROracleForwarderBase {
constructor(address _pot, address _l2Oracle) DSROracleForwarderBase(_pot, _l2Oracle) {
// Intentionally left blank
}
function refresh(
uint256 gasLimit,
uint256 maxFeePerGas,
uint256 baseFee
) public payable {
XChainForwarders.sendMessageArbitrumOne(
address(l2Oracle),
_packMessage(),
gasLimit,
maxFeePerGas,
baseFee
);
}
}
Read Contract
_lastSeenPotData 0x1e1fd291 → uint96, uint120, uint40
getLastSeenChi 0x6d7bfdbf → uint256
getLastSeenDSR 0xcdcc3877 → uint256
getLastSeenPotData 0xead05e68 → tuple
getLastSeenRho 0x95550b55 → uint256
l2Oracle 0x9b5f694a → address
pot 0x4ba2363a → address
Write Contract 1 functions
These functions modify contract state and require a wallet transaction to execute.
refresh 0x4d1374a5
uint256 gasLimit
uint256 maxFeePerGas
uint256 baseFee
Recent Transactions
No transactions found for this address