I hereby claim:
- I am cds-amal on github.
- I am cdsamal (https://keybase.io/cdsamal) on keybase.
- I have a public key ASB-yxPVj2JE_nOQpOMzEYRgBe4bjhXgltCNRmuatrbB4go
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| use std::cell::RefCell; | |
| use std::rc::Rc; | |
| /// A simple tree to walk (standing in for our nested serde types). | |
| enum Node { | |
| Leaf(i32), | |
| Named { name: &'static str, children: Vec<Node> }, | |
| } | |
| /// Shared mutable state: a context stack ("where am I?") and |
meth: 0x072d71b257ECa6B60b5333626F6a55ea1B0c451c https://sepolia.etherscan.io/address/0x072d71b257ECa6B60b5333626F6a55ea1B0c451c
| package cmd | |
| import ( | |
| "bufio" | |
| "context" | |
| "encoding/json" | |
| "fmt" | |
| "io" | |
| "os" | |
| "os/exec" |
| { | |
| "overrides": [ | |
| { | |
| "files": "*.sol", | |
| "options": { | |
| "printWidth": 80, | |
| "tabWidth": 4, | |
| "useTabs": false, | |
| "singleQuote": false, | |
| "bracketSpacing": false |
The memory keyword in Solidity is used to denote a temporary storage location within the Ethereum Virtual Machine (EVM) for variables that are not meant to persist between function calls. This is analogous to RAM in a computer, where data stored in memory is temporary and gets erased after the execution of the function it is used in. The EVM has three primary storage locations for data: storage, memory, and stack.
When you declare a variable with the memory keyword,
| // SPDX-License-Identifier: UNLICENSED | |
| pragma solidity 0.8.21; | |
| contract Empty { | |
| // hi, I'm bar. i was audited | |
| function foo() public {} | |
| function bar() public {} | |
| } | |
| /* |
| { | |
| "overrides": [ | |
| { | |
| "files": "*.sol", | |
| "options": { | |
| "printWidth": 80, | |
| "tabWidth": 4, | |
| "useTabs": false, | |
| "singleQuote": false, | |
| "bracketSpacing": false |
| object "YulString" { | |
| code { | |
| // Deploy the contract | |
| datacopy(0, dataoffset("runtime"), datasize("runtime")) | |
| return(0, datasize("runtime")) | |
| } | |
| object "runtime" { | |
| code { | |
| // don't accept value |
| // SPDX-License-Identifier: MIT | |
| pragma solidity ^0.8.20; | |
| contract A { | |
| function foo() public pure returns (uint) { return bar(); } | |
| function bar() public virtual pure returns (uint) { return 1; } | |
| } | |
| contract B is A { } |