Skip to content

Commit

Permalink
Skip 0s for keccak256 input to make external calculation easier
Browse files Browse the repository at this point in the history
  • Loading branch information
- committed Sep 22, 2023
1 parent bfc6b72 commit 32bfd87
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@SKYBITDev3/deterministic-deployment-proxy",
"description": "An Ethereum proxy contract that can be used for deploying contracts to a deterministic address on any chain.",
"version": "2.0.0",
"version": "2.1.0",
"license": "Unlicense",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion source/deterministic-deployment-proxy.yul
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ object "Proxy" {
code {
mstore(0, caller()) // 32 bytes. The user's address.
mstore(0x20, calldataload(0)) // 32 bytes. User-provided salt.
let callerAndSaltHash := keccak256(0, 0x40) // hash caller with salt to help ensure unique address, prevent front-running. It's cheaper to take whole slots (include padded 0s). Store result on stack.
let callerAndSaltHash := keccak256(0x0c, 0x34) // Hash caller with salt to help ensure unique address, prevent front-running. 12 0s skipped as addresses are only 20 bytes. Store result on stack.

calldatacopy(0, 32, sub(calldatasize(), 32))
let result := create2(callvalue(), 0, sub(calldatasize(), 32), callerAndSaltHash)
Expand Down

0 comments on commit 32bfd87

Please sign in to comment.