Skip to content

Commit

Permalink
update comment in EVMDeployer test contract
Browse files Browse the repository at this point in the history
  • Loading branch information
sisyphusSmiling committed Apr 10, 2024
1 parent 96e9226 commit 3cc726b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cadence/contracts/test/EVMDeployer.cdc
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import "EVM"

/// NOTE: NOT INTENDED FOR PRODUCTION USE - USED FOR TEMPORARY TESTING PURPOSES ONLY
///
/// This contract is intended for testing purposes for the sake of capturing a deployed contract addresses while native
/// `evm.TransactionExecuted` event types are not available in Cadence testing framework. The deploying account should
/// already be configured with a `CadenceOwnedAccount` resource in storage at `/storage/evm`.
///
access(all) contract EVMDeployer {

access(all) let deployedAddresses: {String: EVM.EVMAddress}

access(all) fun deploy(name: String, bytecode: String, value: UInt) {
pre {
self.deployedAddresses[name] == nil: "Already deployed contract under provided"
Expand All @@ -22,7 +24,7 @@ access(all) contract EVMDeployer {
)
self.deployedAddresses[name] = deploymentAddress
}

access(self) fun borrowCOA(): auth(EVM.Deploy) &EVM.CadenceOwnedAccount {
return self.account.storage.borrow<auth(EVM.Deploy) &EVM.CadenceOwnedAccount>(from: /storage/evm)
?? panic("No COA found in storage")
Expand Down

0 comments on commit 3cc726b

Please sign in to comment.