Skip to main content

Function: getProvidedCweb()

function getProvidedCweb(contextTx): bigint;

Function to get the provided CWEB for contract execution from the context of a transaction. This function returns the contract argument number 2 as a number, and by convention, this argument contains the amount of CWEB the contract can use.

Note: the return value of this function is unrelated to the actual CWEB available to the smart contract. This amount is not directly accessible to the smart contract.

Parameters

contextTx: L2TxResolved

The context of the transaction.

Returns

bigint

The provided CWEB for contract execution as a number.


Coinweb © 2024