由编译后的 ABI 生成: BaofaFees.json · 62 函数 · 29 事件 · 61 错误
BaofaFees 在每笔交易时被核心合约读取以获得适用费率,并由创作者及其份额持有人直接调用以完成收益分成。它还持有社交收益账户、捐赠账户与回购划转。下方表格由部署包的 ABI 生成。
常见流程#
| 流程 | 调用顺序 |
|---|---|
| 拆分创作者收益 | createFeeSharingConfig(coin),然后一次 updateFeeShares(coin, next);任何人在核心合约上调用 distributeCreatorFees(coin) 发放 |
| 读取一笔交易的费率 | getFeesWithQuoteClass(consumer, isCanonical, marketCap, quoteClass);feeConfig 与分层读取函数暴露表格本身 |
| 社交收益领取 | 社交领取权限地址为已验证身份调用 claimSocialFee(key, quoteAsset, recipient) |
| 捐赠账户 | createDonationAccount(coin, configId)、fundDonation(coin, configId, units)、crankDonation(coin, configId) |
各流程遵循的规则见 创作者收益与分成。
写入函数#
| 函数 | 输入 | 返回 | 选择器 |
|---|---|---|---|
acceptOwnership |
无 | 无 | 0x79ba5097 |
adminCtoSharingConfig |
address coin, address newAdminOrZero |
bool reset |
0xd8619c87 |
attachAmmModule |
address ammModule |
无 | 0x38b86d8b |
claimSocialFee |
bytes32 key, address quoteAsset, address recipient |
uint64 amount |
0x6288e2a0 |
configureFeesModules |
address coreModule, address ammModule, address relayModule, address frenzyModule, address wrappedNative |
无 | 0x7a595ec7 |
crankDonation |
address coin, bytes32 configId |
uint64 amount |
0x4505168c |
createDonationAccount |
address coin, bytes32 configId |
bytes32 key |
0xb41f9dd4 |
createFeeSharingConfig |
address coin |
无 | 0x8bb80284 |
createSocialFeeAccount |
string userId, uint8 platform |
bytes32 key |
0x17035fcf |
creditBuyback |
uint8 index, address quoteAsset, uint64 amount |
无 | 0x06b9344c |
creditFrenzyFee |
uint8 index, address quoteAsset, uint64 amount |
无 | 0x97333a76 |
diamondCut |
(address,uint8,bytes4[])[] _diamondCut, address _init, bytes _calldata |
无 | 0x1f931c1c |
fundDonation (可付款) |
address coin, bytes32 configId, uint64 units |
无 | 0x4dd49d7a |
fundReferral (可付款) |
address user, address quoteAsset, uint64 units |
无 | 0x7a84d668 |
fundSocialFee (可付款) |
bytes32 key, address quoteAsset, uint64 units |
无 | 0x59abecab |
initializeBuyback |
uint8 index |
无 | 0x9165cd1a |
initializeFeeConfig |
uint8 consumer |
无 | 0x060fb485 |
initializeFeeProgramGlobal |
address socialClaimAuthority, uint8 disableFlags, uint64 claimRateLimit |
无 | 0x1345daec |
renounceOwnership |
无 | 无 | 0x715018a6 |
rescueNative |
address to |
无 | 0xc8df4230 |
setClaimRateLimit |
uint64 claimRateLimit |
无 | 0x8122e7cb |
setDisableFlags |
uint8 disableFlags |
无 | 0xc44d69c3 |
setExoticFlatFees |
uint8 consumer, (uint64,uint64,uint64) exoticFlatFees |
无 | 0x06114d45 |
setFeeAuthority |
address newAuthority |
无 | 0x8a957929 |
setSocialClaimAuthority |
address socialClaimAuthority |
无 | 0x1def7443 |
sweepBuyback |
uint8 index, address quoteAsset, address destination |
uint64 amount |
0x9cc2c930 |
transferOwnership |
address _newOwner |
无 | 0xf2fde38b |
updateBuybackAuthority |
uint8 index, address newAuthority |
无 | 0xf151820d |
updateBuybackClaimRateLimit |
uint8 index, int64 claimRateLimit |
无 | 0x7b7b42f9 |
updateFeeAdmin |
uint8 consumer, address newAdmin |
无 | 0x42de7b83 |
updateFeeConfig |
uint8 consumer, (uint128,(uint64,uint64,uint64))[] feeTiers, (uint64,uint64,uint64) flatFees |
无 | 0xcfebd9c4 |
updateFeeShares |
address coin, (address,uint16)[] next |
无 | 0xcd1d8fa8 |
updateStableFeeConfig |
uint8 consumer, (uint128,(uint64,uint64,uint64))[] stableFeeTiers |
无 | 0x1a32bd04 |
upsertFeeTiers |
uint8 consumer, (uint128,(uint64,uint64,uint64))[] feeTiers, uint8 offset |
无 | 0xb3884653 |
upsertStableFeeTiers |
uint8 consumer, (uint128,(uint64,uint64,uint64))[] stableFeeTiers, uint8 offset |
无 | 0xf3eaa9b5 |
withdrawFrenzyFee |
uint8 index, address quoteAsset, uint64 amount, address to |
无 | 0x808b6751 |
withdrawReferral |
address quoteAsset |
uint64 amount |
0xf705ca75 |
读取函数#
| 函数 | 输入 | 返回 | 选择器 |
|---|---|---|---|
buybackBalance |
uint8 index, address quoteAsset |
uint64 |
0xb77918c7 |
buybackVault |
uint8 index |
(bool,address,uint64,uint64,uint64,int64,int64) |
0xfea5632d |
donationAccount |
address coin, bytes32 configId |
(uint8,bytes32,address,address,address,uint64,int64) |
0x9f724157 |
donationBalance |
address coin, bytes32 configId |
uint64 |
0x913d2ccd |
facetAddress |
bytes4 _functionSelector |
address |
0xcdffacc6 |
facetAddresses |
无 | address[] |
0x52ef6b2c |
facetFunctionSelectors |
address _facet |
bytes4[] |
0xadfca15e |
facets |
无 | (address,bytes4[])[] facets_ |
0x7a0ed627 |
feeConfig |
uint8 consumer |
bool initialized, address admin, ((uint64,uint64,uint64),(uint128,(uint64,uint64,uint64))[],(uint128,(uint64,uint64,uint64))[],(uint64,uint64,uint64)) config |
0x798cfec8 |
feeProgramGlobal |
无 | (bool,address,uint8,address,uint64) |
0x596217dc |
feesModules |
无 | address coreModule, address ammModule, address relayModule, address frenzyModule, address wrappedNative |
0x562a4193 |
frenzyFeeBalance |
uint8 index, address quoteAsset |
uint64 |
0xcfe76a9c |
getFees |
uint8 consumer, bool isCanonical, uint128 marketCap, bool isNewQuote |
(uint64,uint64,uint64) |
0x4378b903 |
getFeesWithQuoteClass |
uint8 consumer, bool isCanonical, uint128 marketCap, uint8 quoteClass |
(uint64,uint64,uint64) |
0xb582c914 |
owner |
无 | address |
0x8da5cb5b |
pendingOwner |
无 | address |
0xe30c3978 |
referralBalance |
address user, address quoteAsset |
uint64 |
0x5dbcc60b |
sharingActive |
address coin |
bool |
0x79b7e8f4 |
sharingAdmin |
address coin |
address |
0x3d98ebd2 |
sharingConfig |
address coin |
(uint8,uint8,address,bool,(address,uint16)[]) |
0xffd1a3b7 |
sharingConfigExists |
address coin |
bool |
0x8bcbd8e2 |
sharingShareholders |
address coin |
(address,uint16)[] |
0x0c172951 |
socialBalance |
bytes32 key, address quoteAsset |
uint64 |
0x760d5995 |
socialFeeAccount |
bytes32 key |
(uint8,uint8,string,uint64,uint64,uint64) |
0xd9a9c524 |
supportsInterface |
bytes4 _interfaceId |
bool |
0x01ffc9a7 |
事件#
| 名称 | 参数 | Topic 0 |
|---|---|---|
CreateFeeSharingConfigEvent |
uint64 timestamp, address indexed coin, address bondingCurve, address pool, address sharingConfig, address indexed admin, (address,uint16)[] initialShareholders, uint8 status |
0x8442f81b35844e26a02991adc200310762be672b5547701120ddab4cb5abd54e |
DiamondCut |
(address,uint8,bytes4[])[] _diamondCut, address _init, bytes _calldata |
0x8faa70878671ccd212d20771b795c50af8fd3ff6cf27f4bde57e5d4de0aeb673 |
DonationAccountCranked |
uint64 timestamp, address indexed signer, bytes32 indexed donationAccount, bytes32 configId, address indexed coin, address quoteAsset, address creator, uint64 amount |
0x3efc2295db606f84acb8c8cf6c24fd5cfdcd3ac478b9eb763f101015825d40d4 |
DonationAccountCreated |
uint64 timestamp, address indexed createdBy, bytes32 indexed donationAccount, bytes32 configId, address indexed coin, address quoteAsset, address creator |
0x4efbc7ea740ae624d4216495e7ea4e2b21e3bdc99aa8d65d30b8c8dedac89819 |
FeesAmmModuleAttached |
address ammModule |
0x91ba91c5853b7f0162e974ce5d735d7998247621e3ab4a72d576d4bc5b9d9dc5 |
FeesModulesConfigured |
address coreModule, address ammModule, address relayModule, address frenzyModule, address wrappedNative |
0x149871c94609e436ab7121ede47d6910c963bca1c51705d71f81766048930c39 |
InitializeFeeConfigEvent |
uint64 timestamp, address indexed admin, uint8 indexed feeConfig |
0xc011dc44ebe5476366dce4d5b21c20e02c4b7aff9915c89f9cc278dc3e8da211 |
InitializeFeeProgramGlobalEvent |
uint64 timestamp, address authority, address socialClaimAuthority, uint8 disableFlags, uint64 claimRateLimit |
0xce1485a94b8333e8cdbc5b866944971befab5e7148304f054a54c1f1e5cd74c5 |
LedgerFunded |
uint64 timestamp, bytes32 indexed key, address indexed quoteAsset, uint64 amount, address indexed funder |
0x2dee31f6aec4ef4c77afc69d717845495b2164189ad3e5dd9473449a2a45dbce |
NativePayoutWrapped |
address indexed recipient, uint256 amount |
0xbeddea0f11ec7dfe2b2f45fe56fb380da6a6597eff6e3e57d9df9cf8cb0c0917 |
NativeRescued |
address indexed to, uint256 amount |
0xe3eb98b7fe2a0c1d490b92af73eeae611e9b00ab3c3f70b20bd7bb43f67a0f43 |
OwnershipTransferred |
address indexed previousOwner, address indexed newOwner |
0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0 |
OwnershipTransferStarted |
address indexed previousOwner, address indexed newOwner |
0x38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e22700 |
ResetFeeSharingConfigEvent |
uint64 timestamp, address indexed coin, address sharingConfig, address indexed oldAdmin, (address,uint16)[] oldShareholders, address indexed newAdmin, (address,uint16)[] newShareholders, uint8 oldVersion, uint8 newVersion |
0x7ad59f8a288e0f0e313f5034a3018c0fa4f140e82fe6b6ac2834ec4650fc7777 |
SetAuthorityEvent |
uint64 timestamp, address indexed oldAuthority, address indexed newAuthority |
0xd341a8d378bb8130c56f5b4ae35c11afe1a66541b39ce5e5d7a5bd64cca8a58f |
SetClaimRateLimitEvent |
uint64 timestamp, uint64 claimRateLimit |
0x4287d8f0f2bba620c01c67d0cbabd986fcccb309e042f55780466b674a3611a3 |
SetDisableFlagsEvent |
uint64 timestamp, uint8 disableFlags |
0x738a4da57ccaab5a2dba7ffa5f8fbb06babc4c9aaa997e1790349e1f2cd99fe2 |
SetExoticFlatFeesEvent |
uint64 timestamp, address indexed admin, uint8 indexed feeConfig, (uint64,uint64,uint64) exoticFlatFees |
0x8f74c149ff024de68596af7f63ffb8dc2b125fe85ad451d7d2729482c7d3b3df |
SetSocialClaimAuthorityEvent |
uint64 timestamp, address socialClaimAuthority |
0x46d9154f5ad5a186ffd722effb566e90838b0cf2539443d18b3d3305a45a918f |
SocialFeeAccountClaimed |
bytes32 indexed socialFeeAccount, address indexed recipient, (uint64,string,uint8,address,uint64,uint64,uint64,uint64,uint64,address,uint64) data |
0xdfe71537310e456bba65043e67fb0c9a05946e6af2b73ec317f457d5d0586e95 |
SocialFeeAccountCreated |
uint64 timestamp, string userId, uint8 platform, bytes32 indexed socialFeeAccount, address indexed createdBy |
0x2b4bfd3e1fdd52eda2d9283b9aa22518075ddecb010ea2aecc5be03b46611568 |
SweepBuybackEvent |
uint64 timestamp, uint8 indexed index, uint64 nativeAmount, uint64 tokenAmount, address indexed destination, address indexed quoteAsset |
0x34f341542a58c23b85173bf8a79219b3c25c93b1ae06797de9a51294d5005edf |
UpdateAdminEvent |
uint64 timestamp, address indexed oldAdmin, address indexed newAdmin |
0x9de9c772cd749f2d8fc7bd7c1c5db3f5dcf9ad6a6f850e9c5b2dc21af65f3ff9 |
UpdateFeeConfigEvent |
uint64 timestamp, address indexed admin, uint8 indexed feeConfig, (uint128,(uint64,uint64,uint64))[] feeTiers, (uint64,uint64,uint64) flatFees |
0x5cfc37c6d6f41fbdca81e67aa4d76bf5e6a35124b7b26eb9ed9bee311f0e532c |
UpdateFeeSharesEvent |
uint64 timestamp, address indexed coin, address sharingConfig, address indexed admin, (address,uint16)[] newShareholders, uint8 version |
0x1dbd3fad75cd45b55a204457675643ad26ff9b8128f90c85f8f0fdc116ea4579 |
UpdateStableFeeConfigEvent |
uint64 timestamp, address indexed admin, uint8 indexed feeConfig, (uint128,(uint64,uint64,uint64))[] stableFeeTiers, (uint64,uint64,uint64) flatFees |
0x447c1291312c46b564d3c94aba82605c89c3ad0e8c8f5bb613f36061fa015e59 |
UpsertFeeTiersEvent |
uint64 timestamp, address indexed admin, uint8 indexed feeConfig, (uint128,(uint64,uint64,uint64))[] feeTiers, uint8 offset |
0x11e0b1f4670e11f86f4ed86245d68024108d0213adc06aa70425bddc99ac9dc3 |
UpsertStableFeeTiersEvent |
uint64 timestamp, address indexed admin, uint8 indexed feeConfig, (uint128,(uint64,uint64,uint64))[] stableFeeTiers, uint8 offset |
0x9610d03eacbb15064b2a0c455dcbe5ce822600feff5850336da5579b8fced37f |
WithdrawEvent |
uint64 timestamp, address indexed user, address indexed quoteAsset, uint64 amount |
0x7fa9f117115173abf04fa9c7d9f4feb7b73a18bddfab496a94ff2b5476dfd8da |
错误#
| 名称 | 参数 | 选择器 |
|---|---|---|
AlreadyInitialized |
无 | 0x0dc149f0 |
BuybackNotInitialized |
无 | 0x46b768c4 |
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 |
ClaimRateLimitExceeded |
无 | 0xa0b51039 |
DonationAccountNotFound |
无 | 0x84b34701 |
DuplicateShareholder |
无 | 0x6d413098 |
FeatureDeactivated |
无 | 0x55fe236e |
FeeConfigTooShort |
无 | 0x96f98ab8 |
FeeSharesAlreadyUpdated |
无 | 0x2466db83 |
FeeTiersEmpty |
无 | 0x749ebf21 |
FeeTiersNotSorted |
无 | 0x972eea02 |
IncorrectFacetCutAction |
uint8 action |
0x7fe9a41e |
InitializationFunctionReverted |
address init, bytes data |
0x192105d7 |
InsufficientValue |
无 | 0x11011294 |
InvalidAdmin |
无 | 0xb5eba9f0 |
InvalidBuybackIndex |
无 | 0x50689106 |
InvalidCoin |
无 | 0xe77c05c1 |
InvalidFeeTotal |
无 | 0x1b2e1be0 |
InvalidPool |
无 | 0x2083cd40 |
InvalidShareTotal |
无 | 0x8b0422b2 |
InvalidSharingConfig |
无 | 0x5d78bdd2 |
MathOverflow |
无 | 0x9d565d4e |
NoBytecodeAtAddress |
address target, string message |
0x919834b9 |
NoCreatorOverrideHeadroom |
无 | 0xc7755380 |
NoFeeTiers |
无 | 0xa274661c |
NoSelectorsProvidedForFacet |
address facet |
0x0a7d736a |
NoShareholders |
无 | 0x81a9440e |
NotAuthorized |
无 | 0xea8e4eb5 |
NotContractOwner |
address caller, address owner |
0xff4127cb |
NothingToRescue |
无 | 0x00f6b210 |
NothingToWithdraw |
无 | 0xd0d04f60 |
NotInitialized |
无 | 0x87138d5c |
NotPendingOwner |
address caller, address pendingOwner |
0x3c29cbb6 |
OffsetNotContinuous |
无 | 0x1cfe4f14 |
PoolCreatorFeesNotSwept |
无 | 0xa9eb5c15 |
PoolRequiredForGraduatedCoin |
无 | 0xcff9308f |
ReentrancyGuardReentrantCall |
无 | 0x3ee5aeb5 |
RemoveFacetAddressMustBeZeroAddress |
address facet |
0xd091bc81 |
RescueFailed |
address to, uint256 amount |
0xd68f8239 |
SafeERC20FailedOperation |
address token |
0x5274afe7 |
ShareCalculationOverflow |
无 | 0x705aaa32 |
SharingConfigAdminRevoked |
无 | 0xc058a69a |
SharingConfigNotActive |
无 | 0xb7f5b0ee |
SharingConfigNotFound |
无 | 0x75196a8d |
SocialAccountNotFound |
无 | 0xfebefc41 |
StringsInsufficientHexLength |
uint256 value, uint256 length |
0xe22e27eb |
TooManyFeeTiers |
无 | 0x08498ba1 |
TooManyShareholders |
无 | 0x4695201f |
UnauthorizedCaller |
无 | 0x5c427cd9 |
UnsupportedQuoteAsset |
无 | 0x6c6c4b88 |
UserIdTooLong |
无 | 0xc3b3a7cb |
ZeroAddress |
无 | 0xd92e233d |
ZeroShareholderNotAllowed |
无 | 0x1e31afb9 |
ZeroShareNotAllowed |
无 | 0x87536237 |