[][src]Module casperlabs_contract_ffi::contract_api::runtime

Functions

call_contract

Call the given contract, passing the given (serialized) arguments to the host in order to have them available to the called contract during its execution. The value returned from the contract call (see ret above) is returned from this function.

get_arg

Return the i-th argument passed to the host for the current module invocation. Note that this is only relevant to contracts stored on-chain since a contract deployed directly is not invoked with any arguments.

get_blocktime
get_caller

Returns caller of current context. When in root context (not in the sub call) - returns None. When in the sub call - returns public key of the account that made the deploy.

get_key

Return the unforgable reference known by the current module under the given name. This either comes from the named_keys of the account or contract, depending on whether the current module is a sub-call or not.

get_phase
has_key

Check if the given name corresponds to a known unforgable reference

is_valid_uref

checks if a uref is valid

list_named_keys
put_key

Put the given key to the named_keys map under the given name

remove_key

Removes key persisted under name in the current context's map.

ret

Returns value to the host, terminating the currently running module.

revert

Stops execution of a contract and reverts execution effects with a given reason.

upgrade_contract_at_uref

Takes the name of a function to store and a contract URef, and overwrites the value under that URef with a new Contract instance containing the original contract's named_keys, the current protocol version, and the newly created bytes of the stored function.