-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f1693ef
commit 3558434
Showing
2 changed files
with
55 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
cadence/transactions/bridge/admin/blocklist/remove_evm_address_from_blocklist.cdc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import "EVM" | ||
|
||
import "FlowEVMBridgeConfig" | ||
|
||
/// Removes the given EVM contract address from the EVMBlocklist if it exists. | ||
/// | ||
/// @param evmContractHex: The EVM contract address to remove from the blocklist | ||
/// | ||
transaction(evmContractHex: String) { | ||
|
||
let evmBlocklist: auth(FlowEVMBridgeConfig.Blocklist) &FlowEVMBridgeConfig.EVMBlocklist | ||
let evmAddress: EVM.EVMAddress | ||
|
||
prepare(signer: auth(BorrowValue) &Account) { | ||
self.evmBlocklist = signer.storage.borrow<auth(FlowEVMBridgeConfig.Blocklist) &FlowEVMBridgeConfig.EVMBlocklist>( | ||
from: FlowEVMBridgeConfig.adminStoragePath | ||
) ?? panic("Could not borrow FlowEVMBridgeConfig Admin reference") | ||
self.evmAddress = EVM.addressFromString(evmContractHex) | ||
} | ||
|
||
execute { | ||
self.evmBlocklist.block(self.evmAddress) | ||
} | ||
|
||
post { | ||
FlowEVMBridgeConfig.isEVMAddressBlocked(self.evmAddress): "Fee was not set correctly" | ||
} | ||
} |