-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: improve structure of fx bridge logic contract
- Loading branch information
1 parent
67b3ec3
commit b658aa5
Showing
28 changed files
with
918 additions
and
1,344 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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,85 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
pragma solidity ^0.8.0; | ||
|
||
interface FxBridgeBase { | ||
struct TokenStatus { | ||
bool isOriginated; | ||
bool isActive; | ||
bool isExist; | ||
} | ||
|
||
struct TransferInfo { | ||
uint256 amount; | ||
address destination; | ||
uint256 fee; | ||
address exchange; | ||
uint256 minExchange; | ||
} | ||
|
||
struct BridgeToken { | ||
address addr; | ||
string name; | ||
string symbol; | ||
uint8 decimals; | ||
} | ||
|
||
struct OracleSignatures { | ||
address[] oracles; | ||
uint256[] powers; | ||
bytes32[] r; | ||
bytes32[] s; | ||
uint8[] v; | ||
} | ||
|
||
struct BridgeCallData { | ||
address sender; | ||
address refund; | ||
address[] tokens; | ||
uint256[] amounts; | ||
address to; | ||
bytes data; | ||
bytes memo; | ||
uint256 timeout; | ||
uint256 gasLimit; | ||
uint256 eventNonce; | ||
} | ||
|
||
/* =============== EVENTS =============== */ | ||
|
||
event TransactionBatchExecutedEvent( | ||
uint256 indexed _batchNonce, | ||
address indexed _token, | ||
uint256 _eventNonce | ||
); | ||
event SendToFxEvent( | ||
address indexed _tokenContract, | ||
address indexed _sender, | ||
bytes32 indexed _destination, | ||
bytes32 _targetIBC, | ||
uint256 _amount, | ||
uint256 _eventNonce | ||
); | ||
event AddBridgeTokenEvent( | ||
address indexed _tokenContract, | ||
string _name, | ||
string _symbol, | ||
uint8 _decimals, | ||
uint256 _eventNonce, | ||
bytes32 _channelIBC | ||
); | ||
event OracleSetUpdatedEvent( | ||
uint256 indexed _newOracleSetNonce, | ||
uint256 _eventNonce, | ||
address[] _oracles, | ||
uint256[] _powers | ||
); | ||
event TransferOwnerEvent(address _token, address _newOwner); | ||
|
||
event SubmitBridgeCallEvent( | ||
address indexed _txOrigin, | ||
uint256 _nonce, | ||
uint256 _eventNonce, | ||
bool _success, | ||
bytes _cause | ||
); | ||
} |
Oops, something went wrong.