bosnet / bosnet/sebak

`api` Package for contract

Open
#222 0 comments 0 reactions 2 assignees Claimed by @soonkuk View on GitHub
Contract enhancement postpone
Dominant language
Go
Stars
44
Forks
12
PR merge metrics
No merged PRs in 30d

Description

- 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? | |

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.