Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Concordium/concordium-rust-smart-contracts
/ functions
Functions
1,394 in github.com/Concordium/concordium-rust-smart-contracts
⨍
Functions
1,394
◇
Types & classes
566
↓ 333 callers
Method
get
(self)
concordium-std/src/impls.rs:513
↓ 231 callers
Method
contract_update
Update a contract by calling one of its entrypoints. If successful, all changes will be saved. Parameters: - `signer`: a [`Signer`] with a number of
contract-testing/src/impls.rs:1086
↓ 192 callers
Method
parameter_cursor
(&self)
concordium-std/src/impls.rs:1900
↓ 147 callers
Method
insert
Sets the value of the entry with the `VacantEntryRaw`’s key. This differs from [`insert_raw`](Self::insert_raw) in that it automatically serializes th
concordium-std/src/impls.rs:479
↓ 117 callers
Method
state
(&self)
concordium-std/src/impls.rs:2657
↓ 116 callers
Method
unwrap_abort
(self)
concordium-std/src/impls.rs:3019
↓ 110 callers
Method
entry
Get an entry for the given key.
concordium-std/src/impls.rs:988
↓ 109 callers
Method
len
(&self)
concordium-std/src/state_btree.rs:271
↓ 108 callers
Method
iter
Get an iterator over the key-value pairs of the map. The iterator returns values in increasing order of keys, where keys are ordered lexicographically
concordium-std/src/impls.rs:1112
↓ 103 callers
Method
parse_return_value
Try to parse the return value into a type that implements [`Deserial`]. Ensures that all bytes of the return value are read.
contract-testing/src/types.rs:621
↓ 98 callers
Method
create_account
Create an account. If an account with a matching address already exists this method will replace it and return the old account. Note that if the fir
contract-testing/src/impls.rs:1460
↓ 94 callers
Method
state_mut
(&mut self)
concordium-std/src/impls.rs:2661
↓ 87 callers
Method
log
Log a serializable event by serializing it with a supplied serializer. Note that the serialized event must be no larger than `512` bytes.
concordium-std/src/traits.rs:623
↓ 86 callers
Method
contract_invoke
Invoke a contract by calling an entrypoint. Similar to [`Chain::contract_update`](Self::contract_update) except that all changes are discarded afterw
contract-testing/src/impls.rs:1236
↓ 78 callers
Method
contract_init
Initialize a contract. Parameters: - `signer`: the signer with a number of keys, which affects the cost. - `sender`: The account paying for the trans
contract-testing/src/impls.rs:659
↓ 73 callers
Method
module_deploy_v1
Deploy a smart contract module using the same validation rules as enforced by the node. The `WasmModule` can be loaded from disk with either [`module
contract-testing/src/impls.rs:509
↓ 58 callers
Method
new_map
Create a new empty [`StateMap`].
concordium-std/src/impls.rs:2414
↓ 56 callers
Method
sender
(&self)
concordium-std/src/impls.rs:2939
↓ 54 callers
Method
insert
(&mut self, key: K, value: V)
concordium-std/src/state_btree.rs:123
↓ 45 callers
Function
module_load_v1_raw
Load a raw wasm module, i.e. one **without** the prefix of 4 version bytes and 4 module length bytes. The module still has to be a valid V1 smart cont
contract-testing/src/impls.rs:2040
↓ 45 callers
Function
wasm_test_file
Get the path to a wasm test file in wasm test folder. This is simply prepends the test folder path to the file name: `WASM_TEST_FOLDER/{file_name}`.
contract-testing/tests/helpers/mod.rs:23
↓ 43 callers
Method
events
Extract all the events logged by all the contracts in the invocation. The events are returned in the order that they are emitted, and are paired with
contract-testing/src/types.rs:515
↓ 41 callers
Method
get_mut
(&mut self)
concordium-std/src/impls.rs:522
↓ 34 callers
Method
or_insert_with
Ensures a value is in the entry by inserting the result of the default function if empty.
concordium-std/src/impls.rs:750
↓ 33 callers
Method
contains
Returns `true` if the set contains a value.
concordium-std/src/impls.rs:1349
↓ 33 callers
Function
module_load_v1
Load a v1 wasm module as it is output from `cargo concordium build`, i.e. **including** the prefix of 4 version bytes and 4 module length bytes.
contract-testing/src/impls.rs:2075
↓ 30 callers
Method
state_and_builder
(&mut self)
concordium-std/src/impls.rs:2687
↓ 27 callers
Method
len
(&self)
concordium-std/src/impls.rs:1807
↓ 27 callers
Method
new_set
Create a new empty [`StateSet`].
concordium-std/src/impls.rs:2420
↓ 27 callers
Method
occupied_or
(self, e: E)
concordium-std/src/impls.rs:722
↓ 26 callers
Method
serial
(&self, out: &mut W)
concordium-std/src/impls.rs:1319
↓ 25 callers
Method
metadata
(&self)
concordium-std/src/impls.rs:1883
↓ 22 callers
Function
deserial
()
concordium-std/tests/derives.rs:25
↓ 22 callers
Method
is_leaf
(&self)
concordium-std/src/state_btree.rs:1249
↓ 22 callers
Method
slot_time
(&self)
concordium-std/src/impls.rs:1725
↓ 21 callers
Method
get_node
Internal function for looking up a node in the tree. This assumes the node is present and traps if this is not the case.
concordium-std/src/state_btree.rs:1058
↓ 21 callers
Method
remove
Remove a key from the map. This also deletes the value in the state.
concordium-std/src/impls.rs:1070
↓ 21 callers
Function
trap
()
concordium-std/src/lib.rs:414
↓ 20 callers
Method
as_ref
(&self)
concordium-cis2/src/lib.rs:1429
↓ 18 callers
Function
initialize_contract_with_alice_tokens
Helper function that sets up the contract with two types of tokens minted to Alice. She has 100 of `TOKEN_0` and 100 of `TOKEN_1`. Alice's account is
examples/cis2-multi/tests/tests.rs:1606
↓ 18 callers
Method
lookup_entry
(&self, key: &[u8])
concordium-std/src/impls.rs:831
↓ 17 callers
Method
remove
Remove a key from the map. This also deletes the value in the state.
concordium-std/src/state_btree.rs:160
↓ 16 callers
Function
deserial_with_state
()
concordium-std/tests/derives.rs:5
↓ 16 callers
Method
invoke_contract
( &self, host: &mut impl HasHost<State>, method: EntrypointName, parameter: &P
concordium-cis2/src/cis2_client.rs:246
↓ 16 callers
Method
or_insert
Ensures a value is in the entry by inserting the default if empty, and returns the [`HasStateEntry`] type. This differs from [`or_insert_raw`](Self::o
concordium-std/src/impls.rs:563
↓ 16 callers
Method
self_address
(&self)
concordium-std/src/impls.rs:2925
↓ 15 callers
Function
initialize_contract_with_alice_names
Helper function that sets up the contract with two names owned by Alice, `NAME_0` and `NAME_1`. Returns the `ContractInvokeSuccess` for the `NAME_1`
examples/nametoken/tests/tests.rs:775
↓ 14 callers
Method
invoke_transfer
(&self, receiver: &AccountAddress, amount: Amount)
concordium-std/src/impls.rs:2553
↓ 14 callers
Method
move_to_start
(&mut self)
concordium-std/src/impls.rs:241
↓ 14 callers
Method
new_box
(&mut self, value: T)
concordium-std/src/impls.rs:2462
↓ 14 callers
Method
owner
(&self)
concordium-std/src/impls.rs:2965
↓ 14 callers
Method
size
(&self)
concordium-std/src/impls.rs:246
↓ 14 callers
Function
unwrap_or_report
(res: syn::Result<TokenStream>)
concordium-std-derive/src/lib.rs:66
↓ 13 callers
Method
and_modify
If the entry is occupied apply the given function to its contents. If the entry is vacant no changes are made.
concordium-std/src/impls.rs:777
↓ 13 callers
Method
to_owned
Convert to owned standard identifier.
concordium-cis2/src/lib.rs:1719
↓ 12 callers
Function
initialize_contract_with_alice_tokens
Helper function that initializes the contract and wraps 100 microCCD into wCCD for Alice.
examples/cis2-wccd/tests/tests.rs:708
↓ 12 callers
Function
invoke
(_tag: u32, _start: *const u8, _length: u32)
concordium-std/src/prims.rs:367
↓ 12 callers
Method
invoke_contract_raw
( &mut self, to: &ContractAddress, parameter: Parameter, method: EntrypointNam
concordium-std/src/impls.rs:2557
↓ 12 callers
Method
tick_block_time
Tick the block time on the [`Chain`] by a [`Duration`]. Returns an error if ticking causes the block time to overflow. # Example ``` # use concordi
contract-testing/src/impls.rs:1731
↓ 11 callers
Method
address
Get the Address of the receiver.
concordium-cis2/src/lib.rs:1388
↓ 11 callers
Method
as_standard_identifier
Convert to standard identifier.
concordium-cis2/src/lib.rs:1751
↓ 11 callers
Method
calculate_energy_cost
Helper function for converting [`Energy`] to [`Amount`] using the two [`ExchangeRate`]s `euro_per_energy` and `micro_ccd_per_euro`.
contract-testing/src/impls.rs:109
↓ 11 callers
Function
initialize_contract_with_alice_tokens
Helper function that sets up the contract with two tokens minted to Alice, `TOKEN_0` and `TOKEN_1`. Only one token can be minted per update, so two u
examples/cis3-nft-sponsored-txs/tests/tests.rs:1074
↓ 10 callers
Method
contract_balance_unchecked
Returns the contract balance from the topmost checkpoint on the changeset. Or, alternatively, from persistence. Preconditions: - Contract must exist.
contract-testing/src/invocation/impls.rs:1228
↓ 10 callers
Function
get_invoke_failure_code
(code: u64)
concordium-std/src/impls.rs:1933
↓ 10 callers
Method
iter_mut
Like [iter](Self::iter), but allows modifying the values during iteration.
concordium-std/src/impls.rs:1130
↓ 10 callers
Method
push_regular_trace_element
Helper for that constructs and pushes a [`DebugTraceElement::Regular`] to the `trace_elements` list provided.
contract-testing/src/invocation/impls.rs:1617
↓ 9 callers
Function
get_balances
Get the `TokenIdU8(1)` balances for Alice and the auction contract.
examples/sponsored-tx-enabled-auction/tests/tests.rs:753
↓ 9 callers
Method
get_node_mut
Internal function for looking up a node, providing mutable access. This assumes the node is present and traps if this is not the case.
concordium-std/src/state_btree.rs:1069
↓ 9 callers
Method
next
(&mut self)
concordium-std/src/impls.rs:896
↓ 9 callers
Method
or_insert_raw
Ensures a value is in the entry by inserting the default if empty, and returns the [`HasStateEntry`] type for the entry.
concordium-std/src/impls.rs:550
↓ 9 callers
Method
read_u8
Read a `u8` in little-endian format. This is optimized to not initialize a dummy value before calling an external function.
concordium-std/src/impls.rs:401
↓ 9 callers
Method
self_balance
(&self)
concordium-std/src/impls.rs:2677
↓ 8 callers
Method
apply_to_balance
Returns a new balance with the `AmountDelta` applied, or a [`BalanceError`] error if the change would result in a negative balance or an overflow.
contract-testing/src/invocation/impls.rs:1873
↓ 8 callers
Method
build
Build the [`Chain`] with the configured options. # Example ``` # use concordium_smart_contract_testing::*; let chain = Chain::builder() // Use zero
contract-testing/src/impls.rs:330
↓ 8 callers
Function
call_produce
Helper to call `produce` on the factory smart contract.
examples/factory/tests/tests.rs:205
↓ 8 callers
Method
contains_key
(&self, key: &K)
concordium-std/src/state_btree.rs:202
↓ 8 callers
Method
create_entry
(&mut self, key: &[u8])
concordium-std/src/impls.rs:821
↓ 8 callers
Method
hash_sha2_256
(&self, data: &[u8])
concordium-std/src/impls.rs:2846
↓ 8 callers
Method
revoke_credential
( &mut self, now: Timestamp, credential_id: CredentialHolderId, )
examples/credential-registry/src/lib.rs:253
↓ 7 callers
Function
check_exchange_rates
Helper function that checks the validity of the exchange rates. More specifically, it checks that the cost of one energy is <= `u64::MAX / `100_000_0
contract-testing/src/impls.rs:2236
↓ 7 callers
Function
create_factory
Helper to create an instance of the factory smart contract.
examples/factory/tests/tests.rs:165
↓ 7 callers
Function
crypto_primitives
()
concordium-std/src/test_env.rs:131
↓ 7 callers
Method
current
Get an immutable reference the current (latest) checkpoint.
contract-testing/src/invocation/impls.rs:1681
↓ 7 callers
Method
debug_trace
An internal helper function to construct a [`DebugTraceElement`] from a set of debug events.
contract-testing/src/invocation/impls.rs:50
↓ 7 callers
Function
deserialize_update_events_of_specified_contract
Deserialize the events from an update.
examples/cis5-smart-contract-wallet/tests/tests.rs:1044
↓ 7 callers
Function
get_balances
Get the `TOKEN_1` balances for Alice and Bob.
examples/cis2-multi/tests/tests.rs:1567
↓ 7 callers
Method
get_status
Compute the credential status based on validity dates and the revocation flag. If a VC is revoked the status will be `Revoked` regardless the validity
templates/credential-registry/src/lib.rs:72
↓ 7 callers
Function
get_token_res
Parses the given tokens and transforms them using the provided worker function. If parsing fails, then an error with the given message is produced.
concordium-std-derive/src/lib.rs:36
↓ 7 callers
Function
get_token_res_env
Parses the given tokens, looks up an environment variable with the parsed input as key and transforms the corresponding value using the provided worke
concordium-std-derive/src/lib.rs:48
↓ 7 callers
Function
initialize_chain_and_contract
Setup chain and contract. Also creates the three accounts, Alice, Bob, and Charlie. Alice is the owner of the contract.
examples/cis5-smart-contract-wallet/tests/tests.rs:757
↓ 7 callers
Function
invoke_view
Invoke the view entrypoint and return its results.
examples/nametoken/tests/tests.rs:824
↓ 7 callers
Method
is_empty
(&self)
concordium-std/src/state_btree.rs:277
↓ 7 callers
Method
iter
(&self)
concordium-std/src/state_btree.rs:284
↓ 7 callers
Method
iterator
(&self, prefix: &[u8])
concordium-std/src/impls.rs:863
↓ 7 callers
Method
read_root
Read and deserialize the state stored at the root of the state trie. If such a state does not exist, or cannot be deserialized into the provided type,
concordium-std/src/traits.rs:332
↓ 6 callers
Method
clear
Clears the map, removing all key-value pairs. This also includes values pointed at, if `V`, for example, is a [StateBox]. **If applicable use [`clear_
concordium-std/src/impls.rs:1011
↓ 6 callers
Method
convert_to_invoke_error
Convert a [`ContractInvokeErrorKind`] to a [`ContractInvokeError`] by calculating the `energy_used` and `transaction_fee`. If the `kind` is an out of
contract-testing/src/impls.rs:1614
↓ 6 callers
Method
current_mut
Get a mutable reference to the current (latest) checkpoint.
contract-testing/src/invocation/impls.rs:1688
↓ 6 callers
Method
external_node_connection
Configure a connection to an external Concordium node. The connection can be used for getting the current exchange rates between CCD, Euro and Energy
contract-testing/src/impls.rs:161
next →
1–100 of 1,394, ranked by callers