Skip to content

Commit ec6bb30

Browse files
docs: Fix variable name mismatch in constructor example (#505)
The code example for the Erc20 new constructor in the documentation contained a typo that would prevent it from compiling. The function signature defined the input parameter as initial_value,but the function body attempted to use an undefined variable named initial_supply. This change renames the parameter in the function signature from initial_value to initial_supply to match its usage throughout the function body. This makes the code example correct, consistent, and runnable.
1 parent bdc6407 commit ec6bb30

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

versioned_docs/version-v5/basics/events.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ See this example:
191191

192192
```rust
193193
#[ink(constructor)]
194-
pub fn new(initial_value: Balance) -> Self {
194+
pub fn new(initial_supply: Balance) -> Self {
195195
let caller = Self::env().caller();
196196
let mut balances = HashMap::new();
197197
balances.insert(caller, initial_supply);

0 commit comments

Comments
 (0)