Skip to content

Commit

Permalink
bump bridge storage fee calculation estimate to 400kB per txn
Browse files Browse the repository at this point in the history
  • Loading branch information
sisyphusSmiling committed Oct 26, 2024
1 parent 8c3c54e commit 0ac49f6
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ transaction(nftIdentifier: String, ids: [UInt256]) {
//
// Set a cap on the withdrawable bridge fee
var approxFee = FlowEVMBridgeUtils.calculateBridgeFee(
bytes: 200_000 // 200 kB as upper bound on movable storage used in a single transaction
bytes: 400_000 // 400 kB as upper bound on movable storage used in a single transaction
) + (FlowEVMBridgeConfig.baseFee * UFix64(ids.length))
// Issue and store bridge-dedicated Provider Capability in storage if necessary
if signer.storage.type(at: FlowEVMBridgeConfig.providerCapabilityStoragePath) == nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ transaction(nftIdentifier: String, ids: [UInt256], recipient: Address) {
//
// Set a cap on the withdrawable bridge fee
var approxFee = FlowEVMBridgeUtils.calculateBridgeFee(
bytes: 200_000 // 200 kB as upper bound on movable storage used in a single transaction
bytes: 400_000 // 400 kB as upper bound on movable storage used in a single transaction
) + (FlowEVMBridgeConfig.baseFee * UFix64(ids.length))
// Issue and store bridge-dedicated Provider Capability in storage if necessary
if signer.storage.type(at: FlowEVMBridgeConfig.providerCapabilityStoragePath) == nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ transaction(nftIdentifier: String, ids: [UInt64], recipient: String) {

// Withdraw the requested NFT & set a cap on the withdrawable bridge fee
var approxFee = FlowEVMBridgeUtils.calculateBridgeFee(
bytes: 200_000 // 200 kB as upper bound on movable storage used in a single transaction
bytes: 400_000 // 400 kB as upper bound on movable storage used in a single transaction
) + (FlowEVMBridgeConfig.baseFee * UFix64(ids.length))
// Determine if the NFT requires onboarding - this impacts the fee required
self.requiresOnboarding = FlowEVMBridge.typeRequiresOnboarding(self.nftType)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ transaction(nftIdentifier: String, ids: [UInt64]) {

// Withdraw the requested NFT & set a cap on the withdrawable bridge fee
var approxFee = FlowEVMBridgeUtils.calculateBridgeFee(
bytes: 200_000 // 200 kB as upper bound on movable storage used in a single transaction
bytes: 400_000 // 400 kB as upper bound on movable storage used in a single transaction
) + (FlowEVMBridgeConfig.baseFee * UFix64(ids.length))
// Determine if the NFT requires onboarding - this impacts the fee required
self.requiresOnboarding = FlowEVMBridge.typeRequiresOnboarding(self.nftType)
Expand Down
2 changes: 1 addition & 1 deletion cadence/transactions/bridge/nft/bridge_nft_from_evm.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ transaction(nftIdentifier: String, id: UInt256) {
//
// Set a cap on the withdrawable bridge fee
var approxFee = FlowEVMBridgeUtils.calculateBridgeFee(
bytes: 200_000 // 200 kB as upper bound on movable storage used in a single transaction
bytes: 400_000 // 400 kB as upper bound on movable storage used in a single transaction
)
// Issue and store bridge-dedicated Provider Capability in storage if necessary
if signer.storage.type(at: FlowEVMBridgeConfig.providerCapabilityStoragePath) == nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ transaction(nftIdentifier: String, id: UInt256, recipient: Address) {
//
// Set a cap on the withdrawable bridge fee
var approxFee = FlowEVMBridgeUtils.calculateBridgeFee(
bytes: 200_000 // 200 kB as upper bound on movable storage used in a single transaction
bytes: 400_000 // 400 kB as upper bound on movable storage used in a single transaction
)
// Issue and store bridge-dedicated Provider Capability in storage if necessary
if signer.storage.type(at: FlowEVMBridgeConfig.providerCapabilityStoragePath) == nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ transaction(nftIdentifier: String, id: UInt64, recipient: String) {
// Withdraw the requested NFT & calculate the approximate bridge fee based on NFT storage usage
self.nft <- collection.withdraw(withdrawID: id)
var approxFee = FlowEVMBridgeUtils.calculateBridgeFee(
bytes: 200_000 // 200 kB as upper bound on movable storage used in a single transaction
bytes: 400_000 // 400 kB as upper bound on movable storage used in a single transaction
)
// Determine if the NFT requires onboarding - this impacts the fee required
self.requiresOnboarding = FlowEVMBridge.typeRequiresOnboarding(self.nft.getType())
Expand Down
2 changes: 1 addition & 1 deletion cadence/transactions/bridge/nft/bridge_nft_to_evm.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ transaction(nftIdentifier: String, id: UInt64) {
// Withdraw the requested NFT & set a cap on the withdrawable bridge fee
self.nft <- collection.withdraw(withdrawID: id)
var approxFee = FlowEVMBridgeUtils.calculateBridgeFee(
bytes: 200_000 // 200 kB as upper bound on movable storage used in a single transaction
bytes: 400_000 // 400 kB as upper bound on movable storage used in a single transaction
)
// Determine if the NFT requires onboarding - this impacts the fee required
self.requiresOnboarding = FlowEVMBridge.typeRequiresOnboarding(self.nft.getType())
Expand Down

0 comments on commit 0ac49f6

Please sign in to comment.