compiler: implement missing System.Contract.* interops

Support System.Contract.IsStandard/CreateStandardAccount syscall.
This commit is contained in:
Evgenii Stratonikov 2020-06-17 11:38:32 +03:00
parent 3762ebdd08
commit 61cae8d8b1
2 changed files with 15 additions and 0 deletions

View file

@ -52,6 +52,9 @@ var syscalls = map[string]map[string]string{
"Create": "System.Contract.Create", "Create": "System.Contract.Create",
"Destroy": "System.Contract.Destroy", "Destroy": "System.Contract.Destroy",
"Update": "System.Contract.Update", "Update": "System.Contract.Update",
"IsStandard": "System.Contract.IsStandard",
"CreateStandardAccount": "System.Contract.CreateStandardAccount",
}, },
"iterator": { "iterator": {
"Concat": "System.Iterator.Concat", "Concat": "System.Iterator.Concat",

View file

@ -32,3 +32,15 @@ func Update(script []byte, manifest []byte) Contract {
// not by any outside code. When contract is deleted all associated storage // not by any outside code. When contract is deleted all associated storage
// items are deleted too. This function uses `System.Contract.Destroy` syscall. // items are deleted too. This function uses `System.Contract.Destroy` syscall.
func Destroy() {} func Destroy() {}
// IsStandard checks if contract with provided hash is a standard signature/multisig contract.
// This function uses `System.Contract.IsStandard` syscall.
func IsStandard(h []byte) bool {
return false
}
// CreateStandardAccount calculates script hash of a given public key.
// This function uses `System.Contract.CreateStandardAccount` syscall.
func CreateStandardAccount(pub []byte) []byte {
return nil
}