mirror of
https://github.com/grassrootseconomics/cic-custodial.git
synced 2024-11-24 15:06:45 +01:00
Mohamed Sohail
9e1d62a014
* wip: add transfer auithorization * feat: update transferAuthPayload * switch to MAX_INT for value and use revoke flag * tranfer handler: fix nonce rollback on EOA account * feat: switch to session based session transfer auth * Demurrage contracts require setting the approval value to 0 before updating the value after the initial limit is set * This implementation auto-revokes every 15 min after arequest is created. Subsequent requests will fail untill the value is set back to 0 * feat: settable approve session timeout
29 lines
972 B
Go
29 lines
972 B
Go
package custodial
|
|
|
|
import "github.com/grassrootseconomics/w3-celo-patch"
|
|
|
|
const (
|
|
Approve = "approve"
|
|
Check = "check"
|
|
GiveTo = "giveTo"
|
|
MintTo = "mintTo"
|
|
NextTime = "nextTime"
|
|
Register = "register"
|
|
Transfer = "transfer"
|
|
TransferFrom = "transferFrom"
|
|
)
|
|
|
|
// Define common smart contrcat ABI's that can be injected into the system container.
|
|
// Any relevant function signature that will be used by the custodial system can be defined here.
|
|
func initAbis() map[string]*w3.Func {
|
|
return map[string]*w3.Func{
|
|
Approve: w3.MustNewFunc("approve(address, uint256)", "bool"),
|
|
Check: w3.MustNewFunc("check(address)", "bool"),
|
|
GiveTo: w3.MustNewFunc("giveTo(address)", "uint256"),
|
|
MintTo: w3.MustNewFunc("mintTo(address, uint256)", "bool"),
|
|
NextTime: w3.MustNewFunc("nextTime(address)", "uint256"),
|
|
Register: w3.MustNewFunc("register(address)", ""),
|
|
Transfer: w3.MustNewFunc("transfer(address,uint256)", "bool"),
|
|
}
|
|
}
|