DeploySEALED
#◇&▪&█╲▫■@╱%▒◇●^■▓#○○●◆?%***◆&□*&■~□?▒%╲*&■▓!?░*◆╲○●╳&◇○▪@▫^●^■$
Transaction ID
Execution Fee
0.00000949 FLOWTransaction Summary
DeployContract deployment
Contract deployment
Script Arguments
0nameString
AgentManager4
1codeString
import FungibleToken from 0xf233dcee88fe0abe
import FlowToken from 0x1654653399040a61
import EVM from 0xe467b9dd11fa00df
/// AgentManager4 - Ultra-minimal bridge manager
/// Strategies are executed via separate transactions, not stored in Agent
access(all) contract AgentManager4 {
access(all) let AgentStoragePath: StoragePath
access(all) event FundsBridgedToEVM(amount: UFix64, evmAddress: String, owner: Address)
access(all) event FundsBridgedFromEVM(amount: UFix64, owner: Address)
access(self) var totalBridgedToEVM: UFix64
access(self) var totalBridgedFromEVM: UFix64
/// Minimal Agent - just tracks that setup is complete
access(all) resource Agent {
access(all) let ownerAddress: Address
access(all) var bridgedToEVM: UFix64
access(all) var bridgedFromEVM: UFix64
init(ownerAddress: Address) {
self.ownerAddress = ownerAddress
self.bridgedToEVM = 0.0
self.bridgedFromEVM = 0.0
}
access(all) fun recordBridgeToEVM(amount: UFix64) {
self.bridgedToEVM = self.bridgedToEVM + amount
AgentManager4.totalBridgedToEVM = AgentManager4.totalBridgedToEVM + amount
}
access(all) fun recordBridgeFromEVM(amount: UFix64) {
self.bridgedFromEVM = self.bridgedFromEVM + amount
AgentManager4.totalBridgedFromEVM = AgentManager4.totalBridgedFromEVM + amount
}
access(all) fun getMetrics(): {String: UFix64} {
return {
"bridgedToEVM": self.bridgedToEVM,
"bridgedFromEVM": self.bridgedFromEVM
}
}
}
access(all) fun createAgent(ownerAddress: Address): @Agent {
return <- create Agent(ownerAddress: ownerAddress)
}
access(all) fun getContractMetrics(): {String: UFix64} {
return {
"totalBridgedToEVM": self.totalBridgedToEVM,
"totalBridgedFromEVM": self.totalBridgedFromEVM
}
}
init() {
self.AgentStoragePath = /storage/AgentManager4
self.totalBridgedToEVM = 0.0
self.totalBridgedFromEVM = 0.0
}
}
Cadence Script
1transaction(name: String, code: String ) {
2 prepare(signer: auth(AddContract) &Account) {
3 signer.contracts.add(name: name, code: code.utf8 )
4 }
5 }