NEWTON
Asked
4 months ago
66
views
0
This question has a bounty of $0.00 in testnet ETH. Answers to this question are eligible to win that bounty.
These are testnet contracts. Not real ETH.
$0.00
Can someone explain to me what Implicit arguments are? How do they work in Cairo lang?
Newton
asked
4 months ago
0
Accepted answer
Implicit argument refers to the arguments which are passed in the curly bracket of the functions of starknet contracts.
Every starknet contract has storage variable. To accurately compute the precise memory address of storage variables, these implicit arguments come in handy. syscall_ptr, pedersen_ptr, and range_check_ptr are the most commonly used implicit arguments:
// This function increases the balance by the given amount.
// syscall_ptr, pedersen_ptr, range_check_ptr are the implicit arguments here
@external
func increase_balance{
syscall_ptr: felt*,
pedersen_ptr: HashBuiltin*,
range_check_ptr,
}(amount: felt) {
let (res) = balance.read();
balance.write(res + amount);
return ();
}
0x086A...cE8D0d
answered
4 months ago
Implicit Arguments in Cairo
What are Event Indexers in Cairo lang? What is a StarkNet indexer?
What are events in Cairo Language?
What libraries are secure to use in Cairo?
What hashing functions are available in Cairo? How are they secure?
How can I define two functions with the same name but not the same arguments?
What are multi-calls in Account Abstraction? What will it bring to the UX?
Can I add Kakarot to my metamask?
How can I define two functions with the same name but not the same arguments?
How do I transform data from javascript to Cairo?
How do I check that my Solidity compiler version is >= 0.8.0 ?
What is the proxy pattern and how it can help make my smart contracts upgradable in Cairo Language?
How do I interact with my Pathfinder node?
How many time does it take for stark to eth starkgate bridge process?