Generated from the compiled ABI: BaofaRelay.json · 33 function · 10 events · 39 errors
BaofaRelay collects donations to campaigns, closes them in epochs, swaps the proceeds to the settlement asset (USDT at launch) through the allow-listed venue and distributes them. Donors call donate or donateNative; the relayer, written once at deployment, closes epochs (closeDonationEpoch) and settles them with swapThenDistribute, distributeWithoutSwap or justSwap followed by distributeAfterJustSwapping. Every settlement is recorded in distribution and swapReceipt for audit. The tables are generated from the deployment package's ABI.
Write Functions#
| Function | Inputs | Returns | Selector |
|---|---|---|---|
acceptOwnership |
none | none | 0x79ba5097 |
closeDonationEpoch |
bytes32 configId, address asset, uint128 epoch |
(uint8,bytes32,address,uint128,uint64) closed |
0x73dcb6ea |
diamondCut |
(address,uint8,bytes4[])[] _diamondCut, address _init, bytes _calldata |
none | 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 (payable) |
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 |
none | 0xf5e60fef |
justSwap |
bytes32 configId, address asset, uint128 epoch, bytes swapData |
(uint8,bytes32,address,uint128,bytes32,bytes32,address,uint64,address) swapped |
0xf815da1a |
renounceOwnership |
none | none | 0x715018a6 |
rescueNative |
address to |
none | 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 |
none | 0xf2fde38b |
upsertAssetWhitelist |
address[] assets |
none | 0xbf595405 |
Read Functions#
| Function | Inputs | Returns | Selector |
|---|---|---|---|
assetScale |
address asset |
uint256 |
0x26cd40ec |
assetWhitelist |
none | 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 |
none | address[] |
0x52ef6b2c |
facetFunctionSelectors |
address _facet |
bytes4[] |
0xadfca15e |
facets |
none | (address,bytes4[])[] facets_ |
0x7a0ed627 |
isWhitelistedAsset |
address asset |
bool |
0xab1dc427 |
owner |
none | address |
0x8da5cb5b |
pendingOwner |
none | address |
0xe30c3978 |
recordKey |
bytes32 configId, address asset |
bytes32 |
0x06695268 |
relayConstants |
none | 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 |
none | bool |
0xb8c70566 |
Events#
| Name | Parameters | 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 |
Errors#
| Name | Parameters | Selector |
|---|---|---|
ArithmeticOverflow |
none | 0xe47ec074 |
AssetNotSafeForDonation |
none | 0xae9482c8 |
BpsSumDoesNotEqualTenThousand |
none | 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 |
none | 0x9de7c265 |
EpochNotClosed |
none | 0x39c15699 |
IncorrectFacetCutAction |
uint8 action |
0x7fe9a41e |
InitializationFunctionReverted |
address init, bytes data |
0x192105d7 |
InputAmountMismatch |
none | 0x7b7923da |
InvalidAdmin |
none | 0xb5eba9f0 |
InvalidAsset |
none | 0xc891add2 |
InvalidAssetContract |
none | 0xa585a72a |
InvalidAssetWhitelist |
none | 0x9204f5eb |
InvalidBalance |
none | 0xc52e3eff |
InvalidBps |
none | 0xc6cc5d7f |
InvalidMessageLength |
none | 0x8d0242c9 |
InvalidState |
none | 0xbaf3f0f7 |
NativeAmountMismatch |
none | 0x677606af |
NoBytecodeAtAddress |
address target, string message |
0x919834b9 |
NoSelectorsProvidedForFacet |
address facet |
0x0a7d736a |
NotContractOwner |
address caller, address owner |
0xff4127cb |
NothingToRescue |
none | 0x00f6b210 |
NotPendingOwner |
address caller, address pendingOwner |
0x3c29cbb6 |
OutputAmountMustBeGreaterThanZero |
none | 0xcdceb291 |
RecordInitialised |
none | 0x27ce1c32 |
ReentrancyGuardReentrantCall |
none | 0x3ee5aeb5 |
RemoveFacetAddressMustBeZeroAddress |
address facet |
0xd091bc81 |
RescueFailed |
address to, uint256 amount |
0xd68f8239 |
SafeERC20FailedOperation |
address token |
0x5274afe7 |
SignerIsNotRelayer |
none | 0x130a1bbc |
TooManyShares |
none | 0x1384a115 |
WhitelistNotSet |
none | 0xdd4669eb |