由编译后的 ABI 生成: BaofaRelay.json · 33 函数 · 10 事件 · 39 错误
BaofaRelay 收集对活动的捐赠,按周期关闭,通过允许名单中的场所把所得兑换为结算资产(上线时为 USDT)并分发。捐赠者调用 donate 或 donateNative;部署时一次写入的中继员关闭周期(closeDonationEpoch),并用 swapThenDistribute、distributeWithoutSwap 或先 justSwap 再 distributeAfterJustSwapping 完成结算。每次结算都记录在 distribution 与 swapReceipt 中以供审计。表格由部署包的 ABI 生成。
写入函数#
| 函数 | 输入 | 返回 | 选择器 |
|---|---|---|---|
acceptOwnership |
无 | 无 | 0x79ba5097 |
closeDonationEpoch |
bytes32 configId, address asset, uint128 epoch |
(uint8,bytes32,address,uint128,uint64) closed |
0x73dcb6ea |
diamondCut |
(address,uint8,bytes4[])[] _diamondCut, address _init, bytes _calldata |
无 | 0x1f931c1c |
distributeAfterJustSwapping |
bytes32 configId, address asset, uint128 epoch, (uint8,address,uint16)[] shares |
(uint8,bytes32,address,uint128,uint64,address,(uint8,address,uint64,uint16)[]) processed |
0xe5df60a5 |
distributeWithoutSwap |
bytes32 configId, address asset, uint128 epoch, (uint8,address,uint16)[] shares |
(uint8,bytes32,address,uint128,uint64,address,(uint8,address,uint64,uint16)[]) processed |
0x66662600 |
donate |
address asset, uint64 amount, bytes32 configId, uint16 tipBps, string message, address creditedTo |
(uint8,bytes32,address,uint128,uint64,uint64,string,address) made |
0x7661e7ea |
donateNative (可付款) |
uint64 amount, bytes32 configId, uint16 tipBps, string message, address creditedTo |
(uint8,bytes32,address,uint128,uint64,uint64,string,address) made |
0x468ea5ee |
initRelay |
address relayer, address settlementAsset, address swapVenue, address wrappedNative, address coreDiamond |
无 | 0xf5e60fef |
justSwap |
bytes32 configId, address asset, uint128 epoch, bytes swapData |
(uint8,bytes32,address,uint128,bytes32,bytes32,address,uint64,address) swapped |
0xf815da1a |
renounceOwnership |
无 | 无 | 0x715018a6 |
rescueNative |
address to |
无 | 0xc8df4230 |
swapThenDistribute |
bytes32 configId, address asset, uint128 epoch, bytes swapData, (uint8,address,uint16)[] shares |
(uint8,bytes32,address,uint128,uint64,address,(uint8,address,uint64,uint16)[]) processed |
0xc1533e1a |
transferOwnership |
address _newOwner |
无 | 0xf2fde38b |
upsertAssetWhitelist |
address[] assets |
无 | 0xbf595405 |
读取函数#
| 函数 | 输入 | 返回 | 选择器 |
|---|---|---|---|
assetScale |
address asset |
uint256 |
0x26cd40ec |
assetWhitelist |
无 | address[] |
0xed98dc06 |
debouncer |
bytes32 configId, address asset |
(uint8,bytes32,address,uint64) |
0x13220792 |
distribution |
bytes32 configId, address asset, uint128 epoch |
(uint8,bytes32,address,uint128,uint64) |
0xa94a71e2 |
distributionId |
bytes32 configId, address asset, uint128 epoch |
bytes32 |
0x2401b547 |
epochTracker |
bytes32 configId, address asset |
(uint8,bytes32,address,uint128) |
0x73378572 |
facetAddress |
bytes4 _functionSelector |
address |
0xcdffacc6 |
facetAddresses |
无 | address[] |
0x52ef6b2c |
facetFunctionSelectors |
address _facet |
bytes4[] |
0xadfca15e |
facets |
无 | (address,bytes4[])[] facets_ |
0x7a0ed627 |
isWhitelistedAsset |
address asset |
bool |
0xab1dc427 |
owner |
无 | address |
0x8da5cb5b |
pendingOwner |
无 | address |
0xe30c3978 |
recordKey |
bytes32 configId, address asset |
bytes32 |
0x06695268 |
relayConstants |
无 | address relayer, address settlementAsset, address swapVenue, address wrappedNative, address coreDiamond, uint8 settlementDecimals |
0xc98bfa37 |
supportsInterface |
bytes4 _interfaceId |
bool |
0x01ffc9a7 |
swapReceipt |
bytes32 configId, address asset, uint128 epoch |
(bool,bytes32,uint64) |
0x496b822d |
trackedBalance |
address asset |
uint256 |
0x8102ef09 |
whitelistSet |
无 | bool |
0xb8c70566 |
事件#
| 名称 | 参数 | Topic 0 |
|---|---|---|
AssetWhitelistUpdated |
address[] assets |
0x7beee122d23f267a54db66f1dc288a416406208119ef02d7107aaf7fa976eeba |
DiamondCut |
(address,uint8,bytes4[])[] _diamondCut, address _init, bytes _calldata |
0x8faa70878671ccd212d20771b795c50af8fd3ff6cf27f4bde57e5d4de0aeb673 |
DonationEpochClosedEvent |
uint8 daasEventDiscriminator, bytes32 indexed configId, address indexed asset, uint128 epoch, uint64 grossEpochAmount |
0xe57cf0ae837e3475ee0e419cfb0d3e8b11b25035445abf337da17345ccfae199 |
DonationEpochJustSwappedEvent |
uint8 daasEventDiscriminator, bytes32 indexed configId, address indexed asset, uint128 epoch, bytes32 distributionId, bytes32 swapReceiptId, address outputHolder, uint64 swapOutputAmount, address settlementAsset |
0x3f78181a262d965f621e2128e6e1409bca08188daf5868bf92e3d7bd2a388741 |
DonationEpochProcessedEvent |
uint8 daasEventDiscriminator, bytes32 indexed configId, address indexed asset, uint128 epoch, uint64 settledAmount, address settlementAsset, (uint8,address,uint64,uint16)[] transfers |
0x905425002ec4d2d976fe506f744ab079a323dd759676f9cecb17db5de14b0309 |
DonationMadeEvent |
uint8 daasEventDiscriminator, bytes32 indexed configId, address indexed asset, uint128 epoch, uint64 grossAmount, uint64 tip, string message, address indexed creditedTo |
0x73f4a0eef0605a74813e12336a788f88e290843e0d50dc2779d6d5076798ef42 |
NativeRescued |
address indexed to, uint256 amount |
0xe3eb98b7fe2a0c1d490b92af73eeae611e9b00ab3c3f70b20bd7bb43f67a0f43 |
OwnershipTransferred |
address indexed previousOwner, address indexed newOwner |
0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0 |
OwnershipTransferStarted |
address indexed previousOwner, address indexed newOwner |
0x38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e22700 |
RelayInitialised |
address relayer, address settlementAsset, address swapVenue, address wrappedNative, address coreDiamond |
0xe0e3f8f6ece2926b18df6226aeb1ed539afb0320039e69023551f1afe9eda7dd |
错误#
| 名称 | 参数 | 选择器 |
|---|---|---|
ArithmeticOverflow |
无 | 0xe47ec074 |
AssetNotSafeForDonation |
无 | 0xae9482c8 |
BpsSumDoesNotEqualTenThousand |
无 | 0x79034b1f |
CannotAddFunctionToDiamondThatAlreadyExists |
bytes4 selector |
0xebbf5d07 |
CannotAddSelectorsToZeroAddress |
bytes4[] selectors |
0x0ae3681c |
CannotRemoveFunctionThatDoesNotExist |
bytes4 selector |
0x7a08a22d |
CannotRemoveImmutableFunction |
bytes4 selector |
0x6fafeb08 |
CannotReplaceFunctionsFromFacetWithZeroAddress |
bytes4[] selectors |
0xcd98a96f |
CannotReplaceFunctionThatDoesNotExists |
bytes4 selector |
0x7479f939 |
CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet |
bytes4 selector |
0x358d9d1a |
CannotReplaceImmutableFunction |
bytes4 selector |
0x520300da |
EpochAlreadyClosed |
无 | 0x9de7c265 |
EpochNotClosed |
无 | 0x39c15699 |
IncorrectFacetCutAction |
uint8 action |
0x7fe9a41e |
InitializationFunctionReverted |
address init, bytes data |
0x192105d7 |
InputAmountMismatch |
无 | 0x7b7923da |
InvalidAdmin |
无 | 0xb5eba9f0 |
InvalidAsset |
无 | 0xc891add2 |
InvalidAssetContract |
无 | 0xa585a72a |
InvalidAssetWhitelist |
无 | 0x9204f5eb |
InvalidBalance |
无 | 0xc52e3eff |
InvalidBps |
无 | 0xc6cc5d7f |
InvalidMessageLength |
无 | 0x8d0242c9 |
InvalidState |
无 | 0xbaf3f0f7 |
NativeAmountMismatch |
无 | 0x677606af |
NoBytecodeAtAddress |
address target, string message |
0x919834b9 |
NoSelectorsProvidedForFacet |
address facet |
0x0a7d736a |
NotContractOwner |
address caller, address owner |
0xff4127cb |
NothingToRescue |
无 | 0x00f6b210 |
NotPendingOwner |
address caller, address pendingOwner |
0x3c29cbb6 |
OutputAmountMustBeGreaterThanZero |
无 | 0xcdceb291 |
RecordInitialised |
无 | 0x27ce1c32 |
ReentrancyGuardReentrantCall |
无 | 0x3ee5aeb5 |
RemoveFacetAddressMustBeZeroAddress |
address facet |
0xd091bc81 |
RescueFailed |
address to, uint256 amount |
0xd68f8239 |
SafeERC20FailedOperation |
address token |
0x5274afe7 |
SignerIsNotRelayer |
无 | 0x130a1bbc |
TooManyShares |
无 | 0x1384a115 |
WhitelistNotSet |
无 | 0xdd4669eb |