Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for EIP-7201 namespaces #127

Merged
merged 35 commits into from
Aug 28, 2023
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
dafdce5
use isStorageVariable helper
frangio Jul 14, 2023
3b19822
initial code for namespaced storage
frangio Jul 14, 2023
ebe94f6
lint
frangio Jul 14, 2023
e5dbedf
error on storage refs in modifiers
frangio Jul 14, 2023
21ead5c
lint
frangio Jul 14, 2023
17e639d
remove unused function
frangio Jul 15, 2023
b6886eb
add line nr to error msg about containment
frangio Aug 16, 2023
a83b0d9
optimize ast resolver tryResolve
frangio Aug 19, 2023
3b95324
fix hardhat import
frangio Aug 19, 2023
221b8d8
finish namespace implementation
frangio Aug 19, 2023
421624c
fix bug in transform-constructor
frangio Aug 19, 2023
759d4e2
update solidity-ast
frangio Aug 19, 2023
aca56c2
0.3.26-0
frangio Aug 19, 2023
5a82888
lint
frangio Aug 19, 2023
487d57f
handle comments after variables
frangio Aug 23, 2023
6283419
0.3.26-1
frangio Aug 23, 2023
54a1b0d
add test
Amxx Aug 24, 2023
9326e84
Update hardhat.config.js
frangio Aug 24, 2023
40051e3
Update src/transformations/utils/new-function-position.ts
frangio Aug 24, 2023
9865f05
disable compilation warnings
frangio Aug 24, 2023
e70cbed
add missing transformation to namespaces test
frangio Aug 24, 2023
fff0862
simplify using flatMap
frangio Aug 24, 2023
f0b7185
Apply verkle changes
frangio Aug 25, 2023
3e6c7c6
Update src/transform.ts
frangio Aug 25, 2023
4e6430f
update test snapshots
frangio Aug 25, 2023
f6deaa0
fix namespace var placement in constructor
frangio Aug 25, 2023
898d35d
lint
frangio Aug 25, 2023
531c062
avoid moving if no variables
frangio Aug 25, 2023
eeaee5c
add comments
frangio Aug 25, 2023
6f80660
simplify getRealEndIndex
frangio Aug 25, 2023
73582e8
simplify transformer abstraction
frangio Aug 25, 2023
0c98349
add new helper contractStartPosition (same as newFunctionPosition)
frangio Aug 25, 2023
c167f52
redefine newFunctionPosition
frangio Aug 25, 2023
949c466
lint
frangio Aug 25, 2023
ffd3824
0.3.26-2
frangio Aug 26, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions contracts/namespaces.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.20;

contract C1 {
}

contract C2 {
event B();

struct A { uint z; }

uint constant C = 3;
// a
uint x;
// b
/// @custom:oz-upgrades-unsafe-allow state-variable-immutable
uint immutable y = 2;
uint private z;

string private s1 = "";

function f() public {
z = 3;
}

function g() public {
}
}

contract C3 {
address private x;
}

contract C4 {
address private x;
constructor() {
x = msg.sender;
}
}

contract C5 {
address private x = msg.sender;
}

contract C6 {
}

contract C7 {
uint x; // a comment

uint y;
// a separate comment
}

contract C8 {
address private x;
address private y = address(this);

constructor() {
x = msg.sender;
}
}
2 changes: 1 addition & 1 deletion hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ internalTask(TASK_COMPILE_SOLIDITY_GET_COMPILER_INPUT, async (args, hre, runSupe

module.exports = {
solidity: {
compilers: [{ version: '0.6.7' }, { version: '0.8.8' }],
compilers: [{ version: '0.6.7' }, { version: '0.8.8' }, { version: '0.8.20' }],
frangio marked this conversation as resolved.
Show resolved Hide resolved
},
};
Loading