5.4 IBC-Ripple
Contract Interface
1
struct Withdrawal {
2
uint wtype; // 0: default, 1: send to cold
3
address user;
4
address extraUser;
5
bytes from;
6
bytes dest;
7
bytes tag;
8
uint amount;
9
bool validated;
10
bool isCanceled;
11
uint fee;
12
uint seq;
13
mapping(address => bytes32) signatureHashs;
14
}
15
16
struct Suggestion {
17
address[] validators;
18
bytes32[] signatureHashs;
19
uint fee;
20
uint seq;
21
}
22
23
mapping(bytes32 => bool) public isDeposited;
24
mapping(uint => Withdrawal) public withdrawals;
25
mapping(uint => mapping(uint => Suggestion)) public suggestions;
26
27
bool public isActivated = true;
28
uint public withdrawalCount;
29
uint public suggestCount;
30
uint public lastWithdrew;
31
uint public lastSelected;
32
uint public lastSequence;
33
uint public xrpBalance;
34
uint public holdingLimit;
35
bytes public xrpWallet;
36
37
bytes coldAddr;
38
bytes32 public tSummary = sha256(abi.encodePacked('XRP', address(1)));
39
40
event XrpDepositRelay(bytes32 txid, bytes xrpWallet, address toAddr, uint amount, address extraToAddr);
41
event XrpDepositValidated(bytes32 txid, bytes xrpWallet, address toAddr, uint amount, address extraToAddr);
42
event XrpDepositColdRelay(bytes32 txid, bytes xrpWallet, uint amount);
43
event XrpDepositColdValidated(bytes32 txid, bytes xrpWallet, uint amount);
44
event XrpWithdrawAdded(uint withdrawId, address balanceAddr, uint withdrawIndex, bytes xrpWallet, uint wtype, address user, address extraUser, bytes dest, bytes tag, uint amount);
45
event XrpWithdrawSuggested(uint suggestIndex, uint withdrawIndex, address[] validators, bytes32[] sigHashs, uint fee, uint seq);
46
event XrpSuggestionValidated(uint suggestIndex, uint withdrawIndex, uint fee, uint seq);
47
event XrpWithdrawValidated(uint withdrawIndex);
48
event XrpTransactionFailed(uint withdrawIndex);
49
event XrpWithdrawCanceled(uint withdrawIndex);
50
51
function relayDeposit(bytes32 txid, address toAddr, uint amount, address extraToAddr) public onlyActivated
52
function relayDepositCold(bytes32 txid, uint amount) public onlyActivated
53
function validateDeposit(bytes32 txid, address toAddr, uint amount, address extraToAddr, address validator, uint8 vSig, bytes32 rSig, bytes32 sSig) public
54
function validateDepositCold(bytes32 txid, uint amount, address validator, uint8 vSig, bytes32 rSig, bytes32 sSig) public
55
function withdraw(uint withdrawId, address user, bytes32 tokenSummary, bytes memory destination, uint amount, bytes memory comment) public onlyActivated
56
function withdraw(uint withdrawId, address user, address extraUser, bytes32 tokenSummary, bytes memory destination, uint amount, bytes memory comment) public onlyActivated
57
function transferToCold() public
58
function suggestWithdraw(uint withdrawIndex, address[] memory validators, bytes32[] memory sigHashs, uint fee, uint seq) public
59
function relaySuggestion(uint withdrawIndex, uint suggestIndex) public
60
function validateSuggestion(uint withdrawIndex, uint suggestIndex, address validator, uint8 vSig, bytes32 rSig, bytes32 sSig) public
61
function relayWithdraw(uint suggestIndex, uint withdrawIndex) public
62
function validateWithdraw(uint withdrawIndex, address validator, uint8[] memory vSigs, bytes32[] memory rSigs, bytes32[] memory sSigs) public
63
function relayTransactionFailed(uint withdrawIndex) public
64
function cancelWithdraw(uint withdrawIndex, address validator, uint8 vSig, bytes32 rSig, bytes32 sSig) public
65
66
function withdrawIndexToSuggest() public view returns(uint)
67
function withdrawIndexToSign() public view returns(uint)
68
function getSuggestionValidators(uint withdrawIndex, uint suggestIndex) public view returns (address[] memory)
69
function getSuggestionSigHashs(uint withdrawIndex, uint suggestIndex) public view returns (bytes32[] memory)
70
function getSignatureHash(uint withdrawIndex, address validator) public view returns (bytes32)
Copied!
Copy link