[][src]Module casperlabs_contract_ffi::contract_api

Modules

pointers

Functions

add

Add the given value to the one currently under the key in the global state

add_uref

Add the given key to the known_urefs map under the given name

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.

fn_by_name

Returns the serialized bytes of a function which is exported in the current module. Note that the function is wrapped up in a new module and re-exported under the name "call". fn_bytes_by_name is meant to be used when storing a contract on-chain at an unforgable reference.

get_arg

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

get_uref

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

has_uref

Check if the given name corresponds to a known unforgable reference

new_uref

Returns a new unforgable pointer, where value is initialized to init

read

Read value under the key in the global state

ret

Return t to the host, terminating the currently running module. Note this function is only relevent to contracts stored on chain which return a value to their caller. The return value of a directly deployed contract is never looked at.

store_function

Gets the serialized bytes of an exported function (see fn_by_name), then computes gets the address from the host to produce a key where the contract is then stored in the global state. This key is returned.

write

Write the value under the key in the global state