sebak icon indicating copy to clipboard operation
sebak copied to clipboard

`api` Package for contract

Open kfangw opened this issue 7 years ago • 0 comments

  • Define functions and wrapper functions for contract execution
API Desc Note
PutStorage(key, value) -> bool,err Write k/v to contract's own storage int,string are support
GetStorage(key) -> value,bool Read value of a key from contract's own storage
WithdrawBalance(to,balance) -> bool Withdraw this contract's balance to another address
GetBalance() -> int Get this contract's balance to another address
CallContract(ContractAddress, method, args) -> value,err Inter contract Call
Now() -> int return timestamp in seconds
BlockHeight() -> int return height of this block
BlockPrevHash() -> string return hash of prev block
tx.Source -> string(address) return source of this tx
log.Print loging?

kfangw avatar Aug 07 '18 08:08 kfangw