-
-
Notifications
You must be signed in to change notification settings - Fork 56
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
♻️ Refactor VyperDeployer
to Allow the Configuration of the Target EVM Version
#161
Conversation
evm_version
Warning for forge install
in README
@zobront thanks a lot for this PR. To clarify: the string[] memory cmds = new string[](4);
cmds[0] = "vyper";
cmds[1] = string.concat(path, fileName, ".vy");
cmds[2] = "--evm-version";
cmds[3] = "paris"; Maybe I can adjust the function deployContract(
string memory path,
string memory fileName
string memory evmVersion
) public returns (address) {
// Create a list of strings with the commands necessary
// to compile Vyper contracts.
string[] memory cmds = new string[](4);
cmds[0] = "vyper";
cmds[1] = string.concat(path, fileName, ".vy");
cmds[2] = "--evm-version";
cmds[3] = evmVersion
} |
@pcaversaccio Of course, makes sense that it's due to the Vyper version defaulting to Shanghai. I like your solution a lot, but wouldn't want to burden everyone who uses I assume you're thinking of adding this as a separate function, so that if they include an EVM version then it'll be included, but otherwise will use the existing function? If that's the case, I think that's a great solution and can update the PR to reflect that change. |
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
evm_version
Warning for forge install
in README
VyperDeployer
to Allow the Configuration of the Target EVM Version
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
I pushed my changes into this PR. I simply use an overloading strategy to provide this convenience. Lmk if you agree with this approach. |
Looks great to me, love the solution 🔥 |
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did some final cleanups (removed unnecessary return statements as we use named returns and used calldata
instead of memory
for the function arguments). Will merged once the CI passed.
Edit by @pcaversaccio: We refactor the
VyperDeployer
to allow the configuration of the EVM version. TheVyperDeployer
contract now offers two overloadeddeployContract
functions that allow the configuration of the target EVM version.Original text by @zobront:
If snekmate is installed with
forge install pcaversaccio/snekmate
in a fresh forge repo, tests will fail because the VyperDeployer's call tocreate
in the assembly block will not properly deploy the contract.To fix, user just needs to ensure that
evm_version = 'shanghai'
in theirfoundry.toml
file.This PR simply adds a warning to the README to make them aware of this.
🐶 Cute Animal Picture