From e2a5662ba70bc7459cf33718ba7a7784fdaab175 Mon Sep 17 00:00:00 2001 From: Giovanni Sanchez <108043524+sisyphusSmiling@users.noreply.github.com> Date: Mon, 6 May 2024 16:36:46 -0500 Subject: [PATCH] add Cadence transaction comments --- cadence/tests/scripts/type_at.cdc | 4 ---- cadence/transactions/bridge/admin/evm/add_deployer.cdc | 6 ++++++ .../bridge/admin/evm/set_delegated_deployer.cdc | 5 +++++ .../bridge/admin/evm/set_deployment_registry.cdc | 9 +++++++++ cadence/transactions/bridge/admin/evm/set_registrar.cdc | 4 ++-- 5 files changed, 22 insertions(+), 6 deletions(-) delete mode 100644 cadence/tests/scripts/type_at.cdc diff --git a/cadence/tests/scripts/type_at.cdc b/cadence/tests/scripts/type_at.cdc deleted file mode 100644 index 0fcbef1f..00000000 --- a/cadence/tests/scripts/type_at.cdc +++ /dev/null @@ -1,4 +0,0 @@ -access(all) -fun main(addr: Address, sp: StoragePath): Type? { - return getAuthAccount(addr).storage.borrow<&AnyResource>(from: sp)?.getType() ?? nil -} \ No newline at end of file diff --git a/cadence/transactions/bridge/admin/evm/add_deployer.cdc b/cadence/transactions/bridge/admin/evm/add_deployer.cdc index 804fdd30..47ad13e7 100644 --- a/cadence/transactions/bridge/admin/evm/add_deployer.cdc +++ b/cadence/transactions/bridge/admin/evm/add_deployer.cdc @@ -3,6 +3,12 @@ import "EVM" import "EVMUtils" import "FlowEVMBridgeUtils" +/// This transaction adds the given EVM address as a deployer in the bridge factory contract, indexed on the +/// provided tag. +/// +/// @param deployerTag: The tag to index the deployer with - e.g. ERC20, ERC721, etc. +/// @param deployerEVMAddressHex: The EVM address of the deployer contract as a hex string, without the '0x' prefix +/// transaction(deployerTag: String, deployerEVMAddressHex: String) { let coa: auth(EVM.Call) &EVM.CadenceOwnedAccount diff --git a/cadence/transactions/bridge/admin/evm/set_delegated_deployer.cdc b/cadence/transactions/bridge/admin/evm/set_delegated_deployer.cdc index ed4c20ab..945f00d7 100644 --- a/cadence/transactions/bridge/admin/evm/set_delegated_deployer.cdc +++ b/cadence/transactions/bridge/admin/evm/set_delegated_deployer.cdc @@ -3,6 +3,11 @@ import "EVM" import "EVMUtils" import "FlowEVMBridgeUtils" +/// Sets the bridge factory contract address as a delegated deployer in the provided deployer contract. This enables the +/// factory contract to deploy new contracts via the deployer contract. +/// +/// @param deployerEVMAddressHex The EVM address of the deployer contract as a hex string without the '0x' prefix +/// transaction(deployerEVMAddressHex: String) { let coa: auth(EVM.Call) &EVM.CadenceOwnedAccount diff --git a/cadence/transactions/bridge/admin/evm/set_deployment_registry.cdc b/cadence/transactions/bridge/admin/evm/set_deployment_registry.cdc index 43b943f0..cfd8c79a 100644 --- a/cadence/transactions/bridge/admin/evm/set_deployment_registry.cdc +++ b/cadence/transactions/bridge/admin/evm/set_deployment_registry.cdc @@ -3,6 +3,15 @@ import "EVM" import "EVMUtils" import "FlowEVMBridgeUtils" +/// This transaction sets the address of the registry contract in the bridge factory contract. The registry contract +/// is tasked with maintaining associations between bridge-deployed EVM contracts and their corresponding Cadence +/// implementations. +/// +/// NOTE: This is a sensitive operation as the registry contract serves as the source of truth for bridge-deployed +/// contracts. +/// +/// @param registryEVMAddressHex The EVM address of the registry contract as a hex string without the '0x' prefix. +/// transaction(registryEVMAddressHex: String) { let coa: auth(EVM.Call) &EVM.CadenceOwnedAccount diff --git a/cadence/transactions/bridge/admin/evm/set_registrar.cdc b/cadence/transactions/bridge/admin/evm/set_registrar.cdc index baf5db3f..25158e2e 100644 --- a/cadence/transactions/bridge/admin/evm/set_registrar.cdc +++ b/cadence/transactions/bridge/admin/evm/set_registrar.cdc @@ -3,8 +3,8 @@ import "EVM" import "EVMUtils" import "FlowEVMBridgeUtils" -/// Sets the registrar address for the provided FlowBridgeDeploymentRegistry address. Should be called by the owner of -/// the registry contract. +/// Sets the bridge factory contract address as the registrar for the provided FlowBridgeDeploymentRegistry address. +/// Should be called by the owner of the registry contract. /// /// @param registryEVMAddressHex The EVM address of the FlowBridgeDeploymentRegistry contract. ///