-
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.
update EVM util scripts & transactions
- Loading branch information
1 parent
1ca51a6
commit c63a9f5
Showing
5 changed files
with
27 additions
and
17 deletions.
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
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
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
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 |
---|---|---|
@@ -1,9 +1,21 @@ | ||
import "Burner" | ||
import "EVM" | ||
|
||
/// !!! CAUTION: Destroys the COA in the signer's account !!! | ||
/// !!! CAUTION: Destroys the COA in the signer's account !!! | ||
/// | ||
transaction { | ||
prepare(signer: auth(LoadValue) &Account) { | ||
destroy signer.storage.load<@EVM.CadenceOwnedAccount>(from: /storage/evm)! | ||
prepare(signer: auth(LoadValue, StorageCapabilities, UnpublishCapability) &Account) { | ||
// Unpublish the COA capability | ||
signer.capabilities.unpublish(/public/evm) | ||
|
||
// Delete all COA capabilities | ||
signer.capabilities.storage.forEachController(forPath: /storage/evm, fun (controller: &StorageCapabilityController): Bool { | ||
controller.delete() | ||
return true | ||
}) | ||
|
||
// Destroy the COA | ||
let coa <- signer.storage.load<@EVM.CadenceOwnedAccount>(from: /storage/evm)! | ||
Burner.burn(<-coa) | ||
} | ||
} |
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