Address Contract Partially Verified
Address
0xe717Ec34b2707fc8c226b34be5eae8482d06ED03
Balance
0 ETH
Nonce
1
Code Size
4256 bytes
Creator
0xa22A61c2...EBb9 at tx 0x8346f7b7...e53d90
Indexed Transactions
1 (24,414,005 → 24,414,005)
Gas Used (indexed)
254,494
Contract Bytecode
4256 bytes
0x608060405234801561001057600080fd5b50600436106100625760003560e01c80631d2ab000146100675780632e77468d1461007c5780633414d32a146100c057806336569e77146100e75780635c1bba381461010e5780638dce54b714610135575b600080fd5b61007a610075366004610c08565b610156565b005b6100a37f00000000000000000000000065c79fcb50ca1594b025960e539ed7a9a6d434a381565b6040516001600160a01b0390911681526020015b60405180910390f35b6100a37f0000000000000000000000005a464c28d19848f44199d003bef5ecc87d090f8781565b6100a37f00000000000000000000000035d1b3f3d7966a1dfe207aa4514c12a259a0492b81565b6100a37f000000000000000000000000238b4e35daed6100c6162fae4510261f88996ec981565b610148610143366004610c84565b61067b565b6040516100b7929190610c9d565b604051637c530f1360e01b8152600481018490527f000000000000000000000000238b4e35daed6100c6162fae4510261f88996ec96001600160a01b031690637c530f1390602401602060405180830381865afa1580156101bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101df9190610cfc565b61020357604051636ac204fb60e11b81526004810184905260240160405180910390fd5b60008061021283850185610dfb565b915091506000805b83518110156103f957600084828151811061023757610237610e5f565b602002602001015190506000807f00000000000000000000000035d1b3f3d7966a1dfe207aa4514c12a259a0492b6001600160a01b031663d9638d36846040518263ffffffff1660e01b815260040161029291815260200190565b60a060405180830381865afa1580156102af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102d39190610e75565b509350505091508160001480156102e8575080155b156102f5575050506103e7565b604051635248181b60e11b8152600481018490526000907f0000000000000000000000005a464c28d19848f44199d003bef5ecc87d090f876001600160a01b03169063a490303690602401602060405180830381865afa15801561035d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103819190610eb5565b9050806001600160a01b031663181783586040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156103be57600080fd5b505af19250505080156103cf575060015b156103e257856103de81610ede565b9650505b505050505b806103f181610ede565b91505061021a565b5060005b825181101561061557600083828151811061041a5761041a610e5f565b6020026020010151905060008060007f00000000000000000000000035d1b3f3d7966a1dfe207aa4514c12a259a0492b6001600160a01b031663d9638d36856040518263ffffffff1660e01b815260040161047791815260200190565b60a060405180830381865afa158015610494573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104b89190610e75565b50935093505092508260001480156104ce575080155b156104dc5750505050610603565b604051631504460f60e01b8152600481018590527f00000000000000000000000065c79fcb50ca1594b025960e539ed7a9a6d434a36001600160a01b031690631504460f90602401600060405180830381600087803b15801561053e57600080fd5b505af1158015610552573d6000803e3d6000fd5b5050604051636cb1c69b60e11b815260048101879052600092507f00000000000000000000000035d1b3f3d7966a1dfe207aa4514c12a259a0492b6001600160a01b0316915063d9638d369060240160a060405180830381865afa1580156105be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105e29190610e75565b5050925050508083146105fd57866105f981610ede565b9750505b50505050505b8061060d81610ede565b9150506103fd565b50806000036106375760405163af6eefa360e01b815260040160405180910390fd5b857f0d83c9346002c9fca728d3a5d743e61837b6479c5773ba8c8ade72febabf4fca84848460405161066b93929190610f40565b60405180910390a2505050505050565b604051637c530f1360e01b8152600481018290526000906060906001600160a01b037f000000000000000000000000238b4e35daed6100c6162fae4510261f88996ec91690637c530f1390602401602060405180830381865afa1580156106e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061070a9190610cfc565b6107445750506040805180820190915260158152742732ba3bb7b9359034b9903737ba1036b0b9ba32b960591b6020820152600092909150565b61074f600080610bce565b61075b60016000610bce565b60007f0000000000000000000000005a464c28d19848f44199d003bef5ecc87d090f876001600160a01b0316630f560cd76040518163ffffffff1660e01b8152600401600060405180830381865afa1580156107bb573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526107e39190810190610f76565b905060005b8151811015610b5557600082828151811061080557610805610e5f565b6020026020010151905060007f0000000000000000000000005a464c28d19848f44199d003bef5ecc87d090f876001600160a01b031663a4903036836040518263ffffffff1660e01b815260040161085f91815260200190565b602060405180830381865afa15801561087c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a09190610eb5565b90506001600160a01b0381166108b7575050610b43565b60008060007f00000000000000000000000035d1b3f3d7966a1dfe207aa4514c12a259a0492b6001600160a01b031663d9638d36866040518263ffffffff1660e01b815260040161090a91815260200190565b60a060405180830381865afa158015610927573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094b9190610e75565b5093509350509250826000148015610961575080155b15610970575050505050610b43565b836001600160a01b031663181783586040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156109ab57600080fd5b505af19250505080156109bc575060015b156109f457600080546001810182559080527f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e563018590555b604051631504460f60e01b8152600481018690527f00000000000000000000000065c79fcb50ca1594b025960e539ed7a9a6d434a36001600160a01b031690631504460f90602401600060405180830381600087803b158015610a5657600080fd5b505af1158015610a6a573d6000803e3d6000fd5b5050604051636cb1c69b60e11b815260048101889052600092507f00000000000000000000000035d1b3f3d7966a1dfe207aa4514c12a259a0492b6001600160a01b0316915063d9638d369060240160a060405180830381865afa158015610ad6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610afa9190610e75565b505092505050808314610b3c576001805480820182556000919091527fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf6018690555b5050505050505b80610b4d81610ede565b9150506107e8565b50600054151580610b67575060015415155b15610b9c57600160006001604051602001610b8392919061103c565b6040516020818303038152906040529250925050915091565b60006040518060400160405280600d81526020016c4e6f20696c6b7320726561647960981b8152509250925050915091565b5080546000825590600052602060002090810190610bec9190610bef565b50565b5b80821115610c045760008155600101610bf0565b5090565b600080600060408486031215610c1d57600080fd5b83359250602084013567ffffffffffffffff80821115610c3c57600080fd5b818601915086601f830112610c5057600080fd5b813581811115610c5f57600080fd5b876020828501011115610c7157600080fd5b6020830194508093505050509250925092565b600060208284031215610c9657600080fd5b5035919050565b821515815260006020604081840152835180604085015260005b81811015610cd357858101830151858201606001528201610cb7565b81811115610ce5576000606083870101525b50601f01601f191692909201606001949350505050565b600060208284031215610d0e57600080fd5b81518015158114610d1e57600080fd5b9392505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715610d6457610d64610d25565b604052919050565b600067ffffffffffffffff821115610d8657610d86610d25565b5060051b60200190565b600082601f830112610da157600080fd5b81356020610db6610db183610d6c565b610d3b565b82815260059290921b84018101918181019086841115610dd557600080fd5b8286015b84811015610df05780358352918301918301610dd9565b509695505050505050565b60008060408385031215610e0e57600080fd5b823567ffffffffffffffff80821115610e2657600080fd5b610e3286838701610d90565b93506020850135915080821115610e4857600080fd5b50610e5585828601610d90565b9150509250929050565b634e487b7160e01b600052603260045260246000fd5b600080600080600060a08688031215610e8d57600080fd5b5050835160208501516040860151606087015160809097015192989197509594509092509050565b600060208284031215610ec757600080fd5b81516001600160a01b0381168114610d1e57600080fd5b600060018201610efe57634e487b7160e01b600052601160045260246000fd5b5060010190565b600081518084526020808501945080840160005b83811015610f3557815187529582019590820190600101610f19565b509495945050505050565b606081526000610f536060830186610f05565b8281036020840152610f658186610f05565b915050826040830152949350505050565b60006020808385031215610f8957600080fd5b825167ffffffffffffffff811115610fa057600080fd5b8301601f81018513610fb157600080fd5b8051610fbf610db182610d6c565b81815260059190911b82018301908381019087831115610fde57600080fd5b928401925b82841015610ffc57835182529284019290840190610fe3565b979650505050505050565b6000815480845260208085019450836000528060002060005b83811015610f3557815487529582019560019182019101611020565b60408152600061104f6040830185611007565b82810360208401526110618185611007565b9594505050505056fea2646970667358221220faf6e44cd82d740bffd838eb7bdeec7b2016673d0af0085919246da346a53e3c64736f6c634300080d0033
Verified Source Code Partial Match
Compiler: v0.8.13+commit.abaa5c0e
EVM: london
Optimization: Yes (200 runs)
OracleJob.sol 160 lines
// SPDX-License-Identifier: AGPL-3.0-or-later
// Copyright (C) 2022 Dai Foundation
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
pragma solidity 0.8.13;
/// @title Maker Keeper Network Job
/// @notice A job represents an independant unit of work that can be done by a keeper
interface IJob {
/// @notice Executes this unit of work
/// @dev Should revert iff workable() returns canWork of false
/// @param network The name of the external keeper network
/// @param args Custom arguments supplied to the job, should be copied from workable response
function work(bytes32 network, bytes calldata args) external;
/// @notice Ask this job if it has a unit of work available
/// @dev This should never revert, only return false if nothing is available
/// @dev This should normally be a view, but sometimes that's not possible
/// @param network The name of the external keeper network
/// @return canWork Returns true if a unit of work is available
/// @return args The custom arguments to be provided to work() or an error string if canWork is false
function workable(bytes32 network) external returns (bool canWork, bytes memory args);
}
interface SequencerLike {
function isMaster(bytes32 network) external view returns (bool);
}
interface IlkRegistryLike {
function list() external view returns (bytes32[] memory);
function pip(bytes32 ilk) external view returns (address);
}
interface VatLike {
function ilks(bytes32 ilk) external view returns (
uint256 Art,
uint256 rate,
uint256 spot,
uint256 line,
uint256 dust
);
}
interface PokeLike {
function poke() external;
}
interface SpotterLike {
function vat() external view returns (address);
function poke(bytes32 ilk) external;
}
/// @title Triggers osm / oracle updates for all ilks
contract OracleJob is IJob {
SequencerLike public immutable sequencer;
IlkRegistryLike public immutable ilkRegistry;
VatLike public immutable vat;
SpotterLike public immutable spotter;
// Don't actually store anything
bytes32[] private toPoke;
bytes32[] private spotterIlksToPoke;
// --- Errors ---
error NotMaster(bytes32 network);
error NotSuccessful();
// --- Events ---
event Work(bytes32 indexed network, bytes32[] toPoke, bytes32[] spotterIlksToPoke, uint256 numSuccessful);
constructor(address _sequencer, address _ilkRegistry, address _spotter) {
sequencer = SequencerLike(_sequencer);
ilkRegistry = IlkRegistryLike(_ilkRegistry);
spotter = SpotterLike(_spotter);
vat = VatLike(spotter.vat());
}
function work(bytes32 network, bytes calldata args) external override {
if (!sequencer.isMaster(network)) revert NotMaster(network);
(bytes32[] memory _toPoke, bytes32[] memory _spotterIlksToPoke) = abi.decode(args, (bytes32[], bytes32[]));
uint256 numSuccessful = 0;
for (uint256 i = 0; i < _toPoke.length; i++) {
bytes32 ilk = _toPoke[i];
(uint256 Art,,, uint256 line,) = vat.ilks(ilk);
if (Art == 0 && line == 0) continue;
PokeLike pip = PokeLike(ilkRegistry.pip(ilk));
try pip.poke() {
numSuccessful++;
} catch {
}
}
for (uint256 i = 0; i < _spotterIlksToPoke.length; i++) {
bytes32 ilk = _spotterIlksToPoke[i];
(uint256 Art,, uint256 beforeSpot, uint256 line,) = vat.ilks(ilk);
if (Art == 0 && line == 0) continue;
spotter.poke(ilk);
(,, uint256 afterSpot,,) = vat.ilks(ilk);
if (beforeSpot != afterSpot) {
numSuccessful++;
}
}
if (numSuccessful == 0) revert NotSuccessful();
emit Work(network, _toPoke, _spotterIlksToPoke, numSuccessful);
}
function workable(bytes32 network) external override returns (bool, bytes memory) {
if (!sequencer.isMaster(network)) return (false, bytes("Network is not master"));
delete toPoke;
delete spotterIlksToPoke;
bytes32[] memory ilks = ilkRegistry.list();
for (uint256 i = 0; i < ilks.length; i++) {
bytes32 ilk = ilks[i];
PokeLike pip = PokeLike(ilkRegistry.pip(ilk));
if (address(pip) == address(0)) continue;
(uint256 Art,, uint256 beforeSpot, uint256 line,) = vat.ilks(ilk);
if (Art == 0 && line == 0) continue; // Skip if no debt / line
// Just try to poke the oracle and add to the list if it works
// This won't add an OSM twice
try pip.poke() {
toPoke.push(ilk);
} catch {
}
// See if the spot price changes
spotter.poke(ilk);
(,, uint256 afterSpot,,) = vat.ilks(ilk);
if (beforeSpot != afterSpot) {
spotterIlksToPoke.push(ilk);
}
}
if (toPoke.length > 0 || spotterIlksToPoke.length > 0) {
return (true, abi.encode(toPoke, spotterIlksToPoke));
} else {
return (false, bytes("No ilks ready"));
}
}
}
Read Contract
ilkRegistry 0x3414d32a → address
sequencer 0x5c1bba38 → address
spotter 0x2e77468d → address
vat 0x36569e77 → address
Write Contract 2 functions
These functions modify contract state and require a wallet transaction to execute.
work 0x1d2ab000
bytes32 network
bytes args
workable 0x8dce54b7
bytes32 network
returns: bool, bytes
Top Interactions
| Address | Txns | Sent | Received |
|---|---|---|---|
| 0xCb4FadD1...C969 | 1 | 1 |
Recent Transactions
|
| Hash | Block | Age | From/To | Value | |
|---|---|---|---|---|---|
| 0x17072755...e94aa6 | 24,414,005 | IN | 0xCb4FadD1...C969 | 0 ETH |