Skip to content

Commit

Permalink
optimize IOracle.RequestInfo (#650)
Browse files Browse the repository at this point in the history
  • Loading branch information
doerfli committed Aug 30, 2024
1 parent 8377ca1 commit 1366374
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
13 changes: 9 additions & 4 deletions contracts/oracle/IOracle.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,19 @@ import {Timestamp} from "../type/Timestamp.sol";
interface IOracle {

struct RequestInfo {
// slot 0
NftId requesterNftId; // originator of the request
string callbackMethodName; // callback function of the requestor to call to provide response data
NftId oracleNftId; // responsible oracle component
bytes requestData;
bytes responseData;
bool isCancelled;
Timestamp respondedAt; // response timestamp
// slot 1
Timestamp expiredAt; // expiry timestamp
bool isCancelled;
// slot 2
string callbackMethodName; // callback function of the requestor to call to provide response data
// slot 3
bytes requestData;
// slot 4
bytes responseData;
}


Expand Down
3 changes: 3 additions & 0 deletions test/mock/MockStorageLayout.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {IAccess} from "../../contracts/authorization/IAccess.sol";
import {IBundle} from "../../contracts/instance/module/IBundle.sol";
import {IComponents} from "../../contracts/instance/module/IComponents.sol";
import {IDistribution} from "../../contracts/instance/module/IDistribution.sol";
import {IOracle} from "../../contracts/oracle/IOracle.sol";
import {IPolicy} from "../../contracts/instance/module/IPolicy.sol";
import {IRegistry} from "../../contracts/registry/IRegistry.sol";
import {IRisk} from "../../contracts/instance/module/IRisk.sol";
Expand Down Expand Up @@ -35,4 +36,6 @@ contract MockStorageLayout {
IAccess.FunctionInfo private _functionInfo;
IAccess.RoleNameInfo private _roleNameInfo;
IAccess.TargeNameInfo private _targetNameInfo;

IOracle.RequestInfo private _requestInfo;
}

0 comments on commit 1366374

Please sign in to comment.