DeploySEALED
~○●&◆?▪○&◆██!&○?%◇%??$!*▪!?!#?!#╱◆#@○◇&!@●●#╳~╲■◆◆*╲^▫●%@$*░╲%▪▒
Transaction ID
Execution Fee
0.00122 FLOWTransaction Summary
DeployContract deployment
Contract deployment
Script Arguments
0nameString
DCAHandlerEVM
1codeString
import FlowTransactionScheduler from 0xe467b9dd11fa00df
import DCAServiceEVM from 0xca7ee55e4fc3251a
/// DCAHandlerEVM: Scheduled Transaction Handler for EVM-Native DCA
///
/// Executes DCA plans via DCAServiceEVM. Rescheduling handled by backend.
///
access(all) contract DCAHandlerEVM {
access(all) event HandlerCreated(uuid: UInt64)
access(all) event ExecutionTriggered(planId: UInt64, success: Bool)
access(all) event ExecutionSkipped(planId: UInt64, reason: String)
access(all) let HandlerStoragePath: StoragePath
access(all) struct TransactionData {
access(all) let planId: UInt64
init(planId: UInt64) { self.planId = planId }
}
access(all) resource Handler: FlowTransactionScheduler.TransactionHandler {
access(FlowTransactionScheduler.Execute)
fun executeTransaction(id: UInt64, data: AnyStruct?) {
let txData = data as? TransactionData
if txData == nil {
log("DCAHandlerEVM: Invalid transaction data")
return
}
let planId = txData!.planId
let planOpt = DCAServiceEVM.getPlan(planId: planId)
if planOpt == nil {
emit ExecutionSkipped(planId: planId, reason: "Plan not found")
return
}
let plan = planOpt!
if plan.getStatus() != DCAServiceEVM.PlanStatus.Active {
emit ExecutionSkipped(planId: planId, reason: "Plan not active")
return
}
let success = DCAServiceEVM.executePlan(planId: planId)
emit ExecutionTriggered(planId: planId, success: success)
}
init() { emit HandlerCreated(uuid: self.uuid) }
}
access(all) fun createHandler(): @Handler { return <- create Handler() }
access(all) fun createTransactionData(planId: UInt64): TransactionData { return TransactionData(planId: planId) }
init() { self.HandlerStoragePath = /storage/DCAHandlerEVM }
}
Cadence Script
1transaction(name: String, code: String ) {
2 prepare(signer: auth(AddContract) &Account) {
3 signer.contracts.add(name: name, code: code.utf8 )
4 }
5 }