-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: deploy Frax Ecosystem OFTs (#1)
* build: fraxfinance/layerzero-v2-upgradeable * feat: FraxOFTUpgradeable * build: fix * fix(deploy): deployment addr/order * refactor: deployFraxOFTUpgradeablesAndProxies * feat: setPeers * feat: admin role setup * refactor: bytes conversion, initial state check * feat: ProxyAdmin * feat: setEnforcedOptions * feat: set DVNs * fix: build * pass until setDVNs() * feat: setSendReceiveLibraries() * feat: deploy local passes * docs: notice on resolving failed `setSendAndReceiveLibrary()` * fix: use default send/receive lib * fix: blast EID * build: deploy addrs * deploy: final script for Mode * ops: deploy v1.0.0 * fix: deterministic ProxyAdmin * feat: deterministic proxy addr * feat: ImplementationMock * ops: deploy v0.1.0
- Loading branch information
1 parent
3697ff1
commit f8cdb55
Showing
13 changed files
with
8,126 additions
and
4,495 deletions.
There are no files selected for viewing
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
3,495 changes: 3,495 additions & 0 deletions
3,495
broadcast/DeployFraxOFTProtocol.s.sol/34443/run-1718039607.json
Large diffs are not rendered by default.
Oops, something went wrong.
3,495 changes: 3,495 additions & 0 deletions
3,495
broadcast/DeployFraxOFTProtocol.s.sol/34443/run-latest.json
Large diffs are not rendered by default.
Oops, something went wrong.
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,50 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.8.22; | ||
|
||
import { OFTUpgradeable } from "@fraxfinance/layerzero-v2-upgradeable/oapp/contracts/oft/OFTUpgradeable.sol"; | ||
import { SendParam } from "@fraxfinance/layerzero-v2-upgradeable/oapp/contracts/oft/interfaces/IOFT.sol"; | ||
|
||
contract FraxOFTUpgradeable is OFTUpgradeable { | ||
constructor(address _lzEndpoint) OFTUpgradeable(_lzEndpoint) {} | ||
|
||
function version() external pure returns (uint256 major, uint256 minor, uint256 patch) { | ||
major = 1; | ||
minor = 0; | ||
patch = 0; | ||
} | ||
|
||
// Admin | ||
|
||
function initialize(string memory _name, string memory _symbol, address _delegate) external initializer { | ||
__OFT_init(_name, _symbol, _delegate); | ||
__Ownable_init(); | ||
_transferOwnership(_delegate); | ||
} | ||
|
||
// Helper views | ||
|
||
function toLD(uint64 _amountSD) external view returns (uint256 amountLD) { | ||
return _toLD(_amountSD); | ||
} | ||
|
||
function toSD(uint256 _amountLD) external view returns (uint64 amountSD) { | ||
return _toSD(_amountLD); | ||
} | ||
|
||
function removeDust(uint256 _amountLD) public view returns (uint256 amountLD) { | ||
return _removeDust(_amountLD); | ||
} | ||
|
||
function debitView(uint256 _amountLD, uint256 _minAmountLD, uint32 _dstEid) external view returns (uint256 amountSentLD, uint256 amountReceivedLD) { | ||
/// @dev: _dstEid is unused in _debitView | ||
return _debitView(_amountLD, _minAmountLD, _dstEid); | ||
} | ||
|
||
function buildMsgAndOptions( | ||
SendParam calldata _sendParam, | ||
uint256 _amountLD | ||
) external view returns (bytes memory message, bytes memory options) { | ||
return _buildMsgAndOptions(_sendParam, _amountLD); | ||
} | ||
|
||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.8.22; | ||
|
||
contract ImplementationMock { | ||
|
||
uint256 public foo; | ||
constructor() {} | ||
|
||
function bar() external { | ||
foo++; | ||
} | ||
} |
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
Oops, something went wrong.