You have to reference two things in the code editor to load and access a smart contract:
- The contract address
- The contract ABI
- in snake_case OR camelCase
- the same for both the
The dot at the end of the line is very important in Prolog. It marks the end of a statement.
The syntax for writing the
ABI_FUNCTIONSis the following:
funtion_name(...input_types): output_type / state_mutability
// View Methods
balanceOf(address, uint256): uint256 / view
name: string / view
// Pure Methods
contractType: bytes32 / pure
// Payable Method
claim(address, uint256): payable
// Non-Payable Method
In Solidity, there are three different
stateMutabilityfor a function: pure/view/payable/nonpayable. With HyperDapp, you need to reference it only when it is pure/view/payable.
If the function name is not camelCase, it must be surrounded by single quotes:
'DEFAULT_ADMIN_ROLE': bytes32 / view
You can load multiple ABIs by using the same syntax as described above. You just need to choose unique smart contract names.