Skip to content

✨ Use create3 for deployment#145

Open
pgonday wants to merge 2 commits intodevelopfrom
bt-1372-factory-create3
Open

✨ Use create3 for deployment#145
pgonday wants to merge 2 commits intodevelopfrom
bt-1372-factory-create3

Conversation

@pgonday
Copy link
Collaborator

@pgonday pgonday commented Feb 26, 2026

@github-actions
Copy link

github-actions bot commented Feb 26, 2026

Changes to gas cost

Generated at commit: 0312f34a68e0c39f3372a912ee56e2b1703dba44, compared to commit: c93f62d86fa9eed6cce3136c68989ef551b30922

🧾 Summary (10% most significant diffs)

Contract Method Avg (+/-) %
IdentityUtilitiesProxy fallback -140,318 ✅ -74.26%
IdFactory createIdentity
createTokenIdentity
+45,351 ❌
+44,226 ❌
+9.51%
+9.87%
Gateway deployIdentityForWallet +27,719 ❌ +8.82%

Full diff report 👇
Contract Deployment Cost (+/-) Method Min (+/-) % Avg (+/-) % Median (+/-) % Max (+/-) % # Calls (+/-)
IdentityUtilitiesProxy 204,576 (0) fallback 37,935 (+32,191) +560.43% 48,625 (-140,318) -74.26% 48,625 (-28,652) -37.08% 59,315 (-1,507,803) -96.22% 2 (-124)
IdFactory 1,682,195 (+37,041) addTokenFactory
createIdentity
createIdentityWithManagementKeys
createTokenIdentity
getIdentity
getToken
getWallets
isTokenFactory
linkWallet
removeTokenFactory
transferOwnership
unlinkWallet
23,747 (-6)
24,650 (-6)
25,940 (+16)
27,297 (-12)
2,824 (-6)
2,636 (-6)
5,179 (-6)
2,563 (-6)
21,606 (-6)
23,814 (-6)
28,643 (+16)
21,629 (-6)
-0.03%
-0.02%
+0.06%
-0.04%
-0.21%
-0.23%
-0.12%
-0.23%
-0.03%
-0.03%
+0.06%
-0.03%
37,727 (-6)
522,130 (+45,351)
236,616 (+15,579)
492,128 (+44,226)
4,279 (-6)
2,636 (-6)
6,697 (-6)
2,563 (-6)
75,503 (-6)
24,962 (-6)
28,643 (+16)
29,307 (-6)
-0.02%
+9.51%
+7.05%
+9.87%
-0.14%
-0.23%
-0.09%
-0.23%
-0.01%
-0.02%
+0.06%
-0.02%
47,530 (-6)
533,586 (+46,173)
31,508 (+60)
514,195 (+46,171)
4,825 (-6)
2,636 (-6)
7,456 (-6)
2,563 (-6)
77,871 (-6)
24,857 (-6)
28,643 (+16)
26,286 (-6)
-0.01%
+9.47%
+0.19%
+9.87%
-0.12%
-0.23%
-0.08%
-0.23%
-0.01%
-0.02%
+0.06%
-0.02%
47,530 (-6)
533,650 (+46,174)
611,290 (+46,122)
514,195 (+46,171)
4,825 (-6)
2,636 (-6)
7,456 (-6)
2,563 (-6)
77,871 (-6)
26,320 (-6)
28,643 (+16)
40,486 (-6)
-0.01%
+9.47%
+8.16%
+9.87%
-0.12%
-0.23%
-0.08%
-0.23%
-0.01%
-0.02%
+0.06%
-0.01%
7 (0)
255 (+2)
8 (0)
132 (+1)
11 (0)
2 (0)
3 (0)
3 (0)
109 (0)
4 (0)
17 (0)
5 (0)
Gateway 1,314,554 (+12) callFactory
deployIdentityForWallet
deployIdentityWithSalt
deployIdentityWithSaltAndManagementKeys
transferFactoryOwnership
24,459 (0)
21,632 (0)
23,612 (0)
24,084 (0)
24,017 (0)
0.00%
0.00%
0.00%
0.00%
0.00%
36,096 (-4)
341,885 (+27,719)
177,210 (+13,193)
214,352 (+14,103)
29,029 (+8)
-0.01%
+8.82%
+8.04%
+7.04%
+0.03%
30,074 (-6)
548,299 (+46,171)
31,601 (0)
34,036 (0)
29,029 (+8)
-0.02%
+9.20%
0.00%
0.00%
+0.03%
53,757 (-6)
548,299 (+46,171)
548,919 (+46,174)
584,069 (+42,314)
34,042 (+16)
-0.01%
+9.20%
+9.18%
+7.81%
+0.05%
3 (0)
5 (0)
7 (0)
6 (0)
2 (0)
IdentityProxy 402,682 (0) fallback 2,675 (0) 0.00% 209,055 (+278) +0.13% 220,154 (0) 0.00% 734,801 (+12) +0.00% 553 (+3)
ERC1967Proxy 204,284 (+12) fallback 7,250 (0) 0.00% 92,367 (-43) -0.05% 18,449 (0) 0.00% 1,200,922 (+12) +0.00% 291 (+2)
Identity 2,452,590 (0) addClaim
addKey
initialize
6,998 (0)
188 (0)
2,893 (0)
0.00%
0.00%
0.00%
297,647 (+51)
181,820 (+47)
225,830 (+11)
+0.02%
+0.03%
+0.00%
307,992 (0)
188,164 (0)
227,319 (0)
0.00%
0.00%
0.00%
373,260 (0)
188,164 (0)
227,319 (0)
0.00%
0.00%
0.00%
149 (+1)
277 (+2)
395 (+3)
ClaimIssuer 3,347,308 (0) addKey
isClaimValid
126,938 (0)
2,327 (0)
0.00%
0.00%
127,111 (-1)
13,168 (+3)
-0.00%
+0.02%
126,938 (0)
13,514 (0)
0.00%
0.00%
148,794 (0)
13,679 (0)
0.00%
0.00%
126 (+1)
152 (+1)
ImplementationAuthority 242,689 (+12) updateImplementation 23,659 (0) 0.00% 25,772 (-4) -0.02% 23,674 (0) 0.00% 29,983 (-12) -0.04% 3 (0)
ClaimIssuerFactory 726,305 (+12)
ClaimIssuerProxy 358,360 (+12)

@pgonday pgonday force-pushed the bt-1372-factory-create3 branch from 4c09b25 to 4107c51 Compare February 26, 2026 09:19

// Infrastructure
IdentityHelper.OnchainIDSetup public onchainidSetup;
address public createx;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what do you think if we declare/init this variable in the CreateXHelper?
createx = _deployCreateX();

so we use the same createx variable in all test files rather than declaring/initiating it in all files

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not relevant with code changes

Comment on lines +11 to +13
function _deployCreateX() internal returns (address) {
string memory artifact = vm.readFile("out/CreateX.sol/CreateX.json");
bytes memory bytecode = vm.parseJsonBytes(artifact, ".bytecode.object");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basically we are dealing with CreateX in different repos, what do you think if we moved the createX functionality from erc3643 to this repo?

The erc3643 imports the onchain id so erc3643 can use createx from this repo as well. In this step the auditors will audit the CreateX just in this repo.

at this point we don't need to deal with out folder.

Thoughts?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have forked CreateX here: https://github.com/TokenySolutions/createx , with an updated solidity pragma so we can use it with ak projects

Comment on lines +35 to +36
.claude
CLAUDE.md
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to mention them? I'm using it too, but just a question if we can add them, same for different repos

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potentially there could be some sensitive data in these files, I don't want to check that at every commit so I prefer not to include them.

Base automatically changed from feature/BT-1497-migrate-to-foundry to develop March 5, 2026 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants