Latest Upgrade ( 2024/07/17 )
There will be additional charge imposed by some DEX aggregators which provide swapping service. Therefore, the YBridgeV3 contract is upgraded to reflect such expense.
New functions
adaptorForAdditionalFeeBlacklist(address): bool: Lookup DEX aggregator adaptors, which provide swapping service, that’s NOT allowed to be used by old version of functionswapWithReferrer(...)additionalFeeReceiver(): For managing purposeadditionalFeeConfig(address): uint256: Lookup the amount of native token it takes to utilize the DEX aggregator adaptor. If it returns0, a default value ofadditionalFeeConfig(address(0))will be charged
Cross chain swap
The old interface,
swapWithReferrer(address,(address,address,address,uint256,uint256),bytes,(uint32,address,uint256,uint32),address): 2aac3cac, is kept.Fees : It doesn’t apply additional fees as before but cannot go through blacklisted DEX aggregator adaptors (
adaptorForAdditionalFeeBlacklist(address): bool).Event : Changed to
SwapRequested(uint256,address,(uint32,address,address,uint256,uint32),address,address,uint256,address,uint256,uint256,address): 0xb0e9a29a6096a927bd389ba0d0d1a15f82df21a331d23a33eeb7de1cf7ab2684fromSwapRequested(uint256,address,(uint32,address,uint256,uint32),address,address,uint256,address,uint256,uint256,address):0x40218dc7047d6a284746d042d62140b3629db83daefcd944659e90b4c74b7eb0
The new overloading interface,
swapWithReferrer(address,(address,address,address,uint256,uint256),bytes,(uint32,address,address,uint256,uint32),address): cdc65927, is added.Fees: It charges native token according to
additionalFeeConfigfor both source chain and destination chain swapping DEX aggregator adaptor used.Mechanism: Same as the old
swapWithReferrer, but charges DEX aggregator adaptor fees according toadditionalFeeConfig. With enoughmsg.valuesent along with the transaction, extra native token would be refunded back to the caller.Event: The same event,
SwapRequested(uint256,address,(uint32,address,address,uint256,uint32),address,address,uint256,address,uint256,uint256,address): 0xb0e9a29a6096a927bd389ba0d0d1a15f82df21a331d23a33eeb7de1cf7ab2684emitted as the otherswapWithReferrer
Last updated
Was this helpful?