Skip to content

Commit

Permalink
fix: merge
Browse files Browse the repository at this point in the history
  • Loading branch information
ashitakah committed Aug 12, 2024
2 parents 242ab9f + 0c70793 commit b920024
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 22 deletions.
28 changes: 7 additions & 21 deletions src/contracts/EBORequestCreator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -49,28 +49,16 @@ contract EBORequestCreator is IEBORequestCreator, Arbitrable {

IOracle.Request memory _requestData = requestData;

_requestData.nonce = uint96(0);
_requestData.requester = address(this);

for (uint256 _i; _i < _chainIds.length; _i++) {
_encodedChainId = _encodeChainId(_chainIds[_i]);
if (!_chainIdsAllowed.contains(_encodedChainId)) revert EBORequestCreator_ChainNotAdded();

if (requestIdPerChainAndEpoch[_chainIds[_i]][_epoch] == bytes32(0)) {
// TODO: COMPLETE THE REQUEST CREATION WITH THE PROPER MODULES
IOracle.Request memory _request = IOracle.Request({
nonce: uint96(0),
requester: address(this),
requestModule: _requestData.requestModule,
responseModule: _requestData.responseModule,
disputeModule: _requestData.disputeModule,
resolutionModule: _requestData.resolutionModule,
finalityModule: _requestData.finalityModule,
requestModuleData: _requestData.requestModuleData,
responseModuleData: _requestData.responseModuleData,
disputeModuleData: _requestData.disputeModuleData,
resolutionModuleData: _requestData.resolutionModuleData,
finalityModuleData: _requestData.finalityModuleData
});

bytes32 _requestId = oracle.createRequest(_request, bytes32(0));
// TODO: CREATE REQUEST DATA
bytes32 _requestId = oracle.createRequest(_requestData, bytes32(0));

requestIdPerChainAndEpoch[_chainIds[_i]][_epoch] = _requestId;

Expand All @@ -82,21 +70,19 @@ contract EBORequestCreator is IEBORequestCreator, Arbitrable {
/// @inheritdoc IEBORequestCreator
function addChain(string calldata _chainId) external onlyArbitrator {
bytes32 _encodedChainId = _encodeChainId(_chainId);
if (_chainIdsAllowed.contains(_encodedChainId)) {
if (!_chainIdsAllowed.add(_encodedChainId)) {
revert EBORequestCreator_ChainAlreadyAdded();
}
_chainIdsAllowed.add(_encodedChainId);

emit ChainAdded(_chainId);
}

/// @inheritdoc IEBORequestCreator
function removeChain(string calldata _chainId) external onlyArbitrator {
bytes32 _encodedChainId = _encodeChainId(_chainId);
if (!_chainIdsAllowed.contains(_encodedChainId)) {
if (!_chainIdsAllowed.remove(_encodedChainId)) {
revert EBORequestCreator_ChainNotAdded();
}
_chainIdsAllowed.remove(_encodedChainId);

emit ChainRemoved(_chainId);
}
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@
resolved "https://registry.yarnpkg.com/@defi-wonderland/prophet-modules-contracts/-/prophet-modules-contracts-0.0.0-1197c328.tgz#f58aa52a5a33fb39a9404bdf5e16ab75fcdde85f"
integrity sha512-78IRF5dSoHvVIzS9/NSqkuQrzPLrVKzRnBvOeSWt/vzoKy3Pm6rkcT5qzWZynIXbFNyMXGTa8HKYBWKFNlaE9A==
dependencies:
"@defi-wonderland/prophet-core-contracts" "0.0.0-d01bc1a0"
"@defi-wonderland/prophet-core" "0.0.0-2e39539b"
"@openzeppelin/contracts" "4.9.5"
solmate "https://github.com/transmissions11/solmate.git#bfc9c25865a274a7827fea5abf6e4fb64fc64e6c"

Expand Down

0 comments on commit b920024

Please sign in to comment.