DeploySEALED
╲@*▒░░▒#╱%@■╳?!╳%╲^&▪!#■░■&▓█╳?^*▓█○■&!╱●╱@&■╱▓▓□▒◆!^@░╳@~░%?&▒╳
Transaction ID
Execution Fee
0.00102 FLOWTransaction Summary
DeployContract deployment
Contract deployment
Script Arguments
0nameString
CounterTransactionHandler
1codeString
import FlowTransactionScheduler from 0xe467b9dd11fa00df
import Counter from 0xca7ee55e4fc3251a
access(all) contract CounterTransactionHandler {
/// Handler resource that implements the Scheduled Transaction interface
access(all) resource Handler: FlowTransactionScheduler.TransactionHandler {
access(FlowTransactionScheduler.Execute) fun executeTransaction(id: UInt64, data: AnyStruct?) {
Counter.increment()
let newCount = Counter.getCount()
log("Transaction executed (id: ".concat(id.toString()).concat(") newCount: ").concat(newCount.toString()))
}
access(all) view fun getViews(): [Type] {
return [Type<StoragePath>(), Type<PublicPath>()]
}
access(all) fun resolveView(_ view: Type): AnyStruct? {
switch view {
case Type<StoragePath>():
return /storage/CounterTransactionHandler
case Type<PublicPath>():
return /public/CounterTransactionHandler
default:
return nil
}
}
}
/// Factory for the handler resource
access(all) fun createHandler(): @Handler {
return <- create Handler()
}
}
Cadence Script
1transaction(name: String, code: String ) {
2 prepare(signer: auth(AddContract) &Account) {
3 signer.contracts.add(name: name, code: code.utf8 )
4 }
5 }