-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into add-optimism-deploy
- Loading branch information
Showing
6 changed files
with
103 additions
and
12 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// 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 | ||
); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// SPDX-License-Identifier: AGPL-3.0-or-later | ||
pragma solidity ^0.8.0; | ||
|
||
import { ArbitrumReceiver } from 'xchain-helpers/ArbitrumReceiver.sol'; | ||
|
||
import { IDSRAuthOracle, IDSROracle } from '../interfaces/IDSRAuthOracle.sol'; | ||
|
||
contract DSROracleReceiverArbitrum is ArbitrumReceiver { | ||
|
||
IDSRAuthOracle public oracle; | ||
|
||
constructor( | ||
address _l1Authority, | ||
IDSRAuthOracle _oracle | ||
) ArbitrumReceiver(_l1Authority) { | ||
oracle = _oracle; | ||
} | ||
|
||
function setPotData(IDSROracle.PotData calldata data) external onlyCrossChainMessage { | ||
oracle.setPotData(data); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// SPDX-License-Identifier: AGPL-3.0-or-later | ||
pragma solidity ^0.8.0; | ||
|
||
import { ArbitrumDomain } from "xchain-helpers/testing/ArbitrumDomain.sol"; | ||
|
||
import { DSROracleForwarderArbitrumOne } from "src/forwarders/DSROracleForwarderArbitrumOne.sol"; | ||
import { DSROracleReceiverArbitrum } from "src/receivers/DSROracleReceiverArbitrum.sol"; | ||
|
||
import "./DSROracleXChainIntegrationBase.t.sol"; | ||
|
||
contract DSROracleIntegrationArbitrumTest is DSROracleXChainIntegrationBaseTest { | ||
|
||
DSROracleForwarderArbitrumOne forwarder; | ||
DSROracleReceiverArbitrum receiver; | ||
|
||
function setupDomain() internal override { | ||
remote = new ArbitrumDomain(getChain('arbitrum_one'), mainnet); | ||
|
||
mainnet.selectFork(); | ||
|
||
address expectedReceiver = computeCreateAddress(address(this), 5); | ||
forwarder = new DSROracleForwarderArbitrumOne(address(pot), expectedReceiver); | ||
|
||
remote.selectFork(); | ||
|
||
oracle = new DSRAuthOracle(); | ||
receiver = new DSROracleReceiverArbitrum(address(forwarder), oracle); | ||
|
||
oracle.grantRole(oracle.DATA_PROVIDER_ROLE(), address(receiver)); | ||
|
||
assertEq(address(receiver), expectedReceiver); | ||
} | ||
|
||
function doRefresh() internal override { | ||
forwarder.refresh{value:1 ether}(500_000, 1 gwei, block.basefee + 10 gwei); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters