-
Notifications
You must be signed in to change notification settings - Fork 341
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
feat: add computeCreateAddress helper function in Script #109
Conversation
ik forge-std doesn't place a large emphasis on comments, but i think given the amount of magic constants in this code its worth using a commented impl like |
src/Script.sol
Outdated
@@ -11,4 +11,50 @@ abstract contract Script { | |||
address(bytes20(uint160(uint256(keccak256('hevm cheat code'))))); | |||
|
|||
Vm public constant vm = Vm(VM_ADDRESS); | |||
|
|||
// Calcuate the corresponding contract creation address for a given address and nonce | |||
function addressFrom(address origin, uint256 nonce) internal pure returns (address creation) { |
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.
Thoughts on renaming to something like computeCreateAddress
, that way adding another computeCreate2Address
fits nicely?
Nice point, I've updated it to use an impl based on that one, thanks! |
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.
lgtm, barring name change
@brockelmore would you prefer |
|
@brockelmore agreed, already changed to that in my last commit ser |
lmfao sorry, will merge |
just realized this broke solidity 0.6.x compiler version cuz CI was tightly configured to only run for certain contributors :(. @devanonon can you try to fix, sorry |
This reverts commit 914702a.
@brockelmore Just realized that too and am on it, no worries :) |
No description provided.