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

Move to foundry #130

Merged
merged 2 commits into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
19 changes: 19 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# EditorConfig http://EditorConfig.org

# top-most EditorConfig file
root = true

# All files
[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.sol]
indent_size = 4

[*.tree]
indent_size = 1
11 changes: 11 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export API_KEY_ALCHEMY="YOUR_API_KEY_ALCHEMY"
export API_KEY_ARBISCAN="YOUR_API_KEY_ARBISCAN"
export API_KEY_BSCSCAN="YOUR_API_KEY_BSCSCAN"
export API_KEY_ETHERSCAN="YOUR_API_KEY_ETHERSCAN"
export API_KEY_GNOSISSCAN="YOUR_API_KEY_GNOSISSCAN"
export API_KEY_INFURA="YOUR_API_KEY_INFURA"
export API_KEY_OPTIMISTIC_ETHERSCAN="YOUR_API_KEY_OPTIMISTIC_ETHERSCAN"
export API_KEY_POLYGONSCAN="YOUR_API_KEY_POLYGONSCAN"
export API_KEY_SNOWTRACE="YOUR_API_KEY_SNOWTRACE"
export MNEMONIC="YOUR_MNEMONIC"
export FOUNDRY_PROFILE="default"
100 changes: 100 additions & 0 deletions .gas-report
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
| contracts/registry/UsernameRegistrar.sol:UsernameRegistrar contract | | | | | |
|---------------------------------------------------------------------|-----------------|--------|--------|--------|---------|
| Deployment Cost | Deployment Size | | | | |
| 3402568 | 17188 | | | | |
| Function Name | min | avg | median | max | # calls |
| activate | 46312 | 46554 | 46312 | 54312 | 33 |
| controller | 2414 | 2414 | 2414 | 2414 | 3 |
| dropUsername | 14543 | 14543 | 14543 | 14543 | 2 |
| ensNode | 406 | 1406 | 1406 | 2406 | 60 |
| ensRegistry | 2460 | 2460 | 2460 | 2460 | 3 |
| getAccountBalance | 504 | 504 | 504 | 504 | 15 |
| getAccountOwner | 517 | 517 | 517 | 517 | 15 |
| getCreationTime | 534 | 534 | 534 | 534 | 8 |
| migrateRegistry | 46313 | 46313 | 46313 | 46313 | 4 |
| moveRegistry | 61618 | 64743 | 61618 | 74118 | 4 |
| parentRegistry | 2415 | 2415 | 2415 | 2415 | 3 |
| price | 407 | 1709 | 2407 | 2407 | 43 |
| receiveApproval | 179225 | 226287 | 216007 | 296460 | 6 |
| register | 2347 | 161736 | 182881 | 295616 | 27 |
| release | 1397 | 18701 | 7181 | 67939 | 9 |
| releaseDelay | 2407 | 2407 | 2407 | 2407 | 11 |
| reserveSlash | 44793 | 44793 | 44793 | 44793 | 8 |
| reservedUsernamesMerkleRoot | 2386 | 2386 | 2386 | 2386 | 3 |
| resolver | 2373 | 2373 | 2373 | 2373 | 3 |
| slashAddressLikeUsername | 900 | 19479 | 1100 | 92995 | 5 |
| slashInvalidUsername | 841 | 19100 | 2749 | 91647 | 7 |
| slashSmallUsername | 93435 | 93435 | 93435 | 93435 | 1 |
| state | 396 | 396 | 396 | 396 | 2 |
| token | 2458 | 2458 | 2458 | 2458 | 3 |
| updateAccountOwner | 1879 | 4055 | 4133 | 6074 | 4 |
| updateRegistryPrice | 10674 | 10674 | 10674 | 10674 | 1 |
| usernameMinLength | 2341 | 2341 | 2341 | 2341 | 3 |


| contracts/test/MerkleProofWrapper.sol:MerkleProofWrapper contract | | | | | |
|-------------------------------------------------------------------|-----------------|------|--------|------|---------|
| Deployment Cost | Deployment Size | | | | |
| 104953 | 555 | | | | |
| Function Name | min | avg | median | max | # calls |
| verifyProof | 1084 | 1340 | 1463 | 1473 | 3 |


| lib/ens-contracts/contracts/registry/ENSRegistry.sol:ENSRegistry contract | | | | | |
|---------------------------------------------------------------------------|-----------------|-------|--------|-------|---------|
| Deployment Cost | Deployment Size | | | | |
| 508871 | 2519 | | | | |
| Function Name | min | avg | median | max | # calls |
| owner | 533 | 1229 | 533 | 2533 | 198 |
| resolver | 476 | 809 | 476 | 2476 | 12 |
| setOwner | 2395 | 2861 | 2395 | 5195 | 24 |
| setResolver | 4478 | 12438 | 4478 | 24378 | 15 |
| setSubnodeOwner | 3061 | 22583 | 24961 | 26961 | 109 |


| lib/ens-contracts/contracts/resolvers/PublicResolver.sol:PublicResolver contract | | | | | |
|----------------------------------------------------------------------------------|-----------------|-------|--------|-------|---------|
| Deployment Cost | Deployment Size | | | | |
| 1936168 | 9732 | | | | |
| Function Name | min | avg | median | max | # calls |
| addr | 1431 | 2011 | 1431 | 3173 | 6 |
| pubkey | 647 | 1980 | 647 | 4647 | 6 |
| setAddr | 31672 | 31672 | 31672 | 31672 | 4 |
| setPubkey | 47679 | 48679 | 48679 | 49679 | 4 |


| lib/minime/contracts/MiniMeToken.sol:MiniMeToken contract | | | | | |
|-----------------------------------------------------------|-----------------|--------|--------|--------|---------|
| Deployment Cost | Deployment Size | | | | |
| 1778095 | 10235 | | | | |
| Function Name | min | avg | median | max | # calls |
| allowance | 763 | 829 | 763 | 2763 | 30 |
| approve | 3072 | 26261 | 27248 | 31748 | 24 |
| approveAndCall | 207970 | 255032 | 244752 | 325205 | 6 |
| generateTokens | 94463 | 94463 | 94463 | 94463 | 27 |
| transfer | 8527 | 42256 | 50744 | 73156 | 7 |
| transferFrom | 4089 | 50070 | 51773 | 51773 | 28 |


| script/Deploy.s.sol:Deploy contract | | | | | |
|-------------------------------------|-----------------|----------|----------|----------|---------|
| Deployment Cost | Deployment Size | | | | |
| 13947631 | 70759 | | | | |
| Function Name | min | avg | median | max | # calls |
| migration | 3489520 | 3489520 | 3489520 | 3489520 | 4 |
| run | 13054107 | 13054107 | 13054107 | 13054107 | 38 |


| script/DeploymentConfig.s.sol:DeploymentConfig contract | | | | | |
|---------------------------------------------------------|-----------------|------|--------|-------|---------|
| Deployment Cost | Deployment Size | | | | |
| 9560657 | 49600 | | | | |
| Function Name | min | avg | median | max | # calls |
| ETH_LABELHASH | 240 | 240 | 240 | 240 | 38 |
| ETH_NAMEHASH | 239 | 239 | 239 | 239 | 80 |
| getActiveNetworkConfig | 2964 | 3864 | 2964 | 20964 | 80 |
| getNameHash | 520 | 520 | 520 | 520 | 80 |




41 changes: 41 additions & 0 deletions .gas-snapshot
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
MerkleProofTest:testVerifyProof_InvalidLengthProof() (gas: 18347)
MerkleProofTest:testVerifyProof_InvalidProof() (gas: 19315)
MerkleProofTest:testVerifyProof_ValidProof() (gas: 19390)
UsernameRegistrarActivateTest:testActivateRegistry() (gas: 103750)
UsernameRegistrarActivateTest:testDeployment() (gas: 44066)
UsernameRegistrarActivateTest:testRegisterUnactivated() (gas: 10899)
UsernameRegistrarActivateTest:testUser() (gas: 2381)
UsernameRegistrarRegisterTest:testDeployment() (gas: 44066)
UsernameRegistrarRegisterTest:testMoveRegistry() (gas: 3608109)
UsernameRegistrarRegisterTest:testRegisterAlreadyInUse() (gas: 346672)
UsernameRegistrarRegisterTest:testRegisterUsername() (gas: 326741)
UsernameRegistrarRegisterTest:testRegisterUsernameApproveAndCall() (gas: 329447)
UsernameRegistrarRegisterTest:testRegisterUsernameWithAccountAndPubKey() (gas: 457681)
UsernameRegistrarRegisterTest:testRegisterUsernameWithAccountAndPubKeyApproveAndCall() (gas: 460516)
UsernameRegistrarRegisterTest:testRegisterUsernameWithNoAllowanceOrBalance() (gas: 322802)
UsernameRegistrarRegisterTest:testRegisterUsernameWithOnlyAddress() (gas: 409167)
UsernameRegistrarRegisterTest:testRegisterUsernameWithOnlyAddressApproveAndCall() (gas: 411910)
UsernameRegistrarRegisterTest:testRegisterUsernameWithOnlyPubkey() (gas: 425643)
UsernameRegistrarRegisterTest:testRegisterUsernameWithOnlyPubkeyApproveAndCall() (gas: 428388)
UsernameRegistrarRegisterTest:testRegisterUsernameWithoutAnything() (gas: 329789)
UsernameRegistrarRegisterTest:testRegisterUsernameWithoutAnythingApproveAndCall() (gas: 332577)
UsernameRegistrarRegisterTest:testReleaseUsername() (gas: 296384)
UsernameRegistrarRegisterTest:testReleaseUsernameByNewOwner() (gas: 337116)
UsernameRegistrarRegisterTest:testReleaseWhenMigrated() (gas: 3838975)
UsernameRegistrarRegisterTest:testReleaseWhenMigratedByOldOwner() (gas: 3846579)
UsernameRegistrarRegisterTest:testShouldNotReleaseUsernameBeforeDelay() (gas: 329620)
UsernameRegistrarRegisterTest:testShouldNotReleaseUsernameFromOther() (gas: 329566)
UsernameRegistrarRegisterTest:testShouldNotReleaseUsernameNotRegistered() (gas: 334190)
UsernameRegistrarRegisterTest:testShouldNotSlashUsernameThatDoesNotStartWith0AndIsBiggerThan12() (gas: 373854)
UsernameRegistrarRegisterTest:testShouldNotSlashUsernameThatDoesNotStartWith0xAndIsBiggerThan12() (gas: 374020)
UsernameRegistrarRegisterTest:testShouldNotSlashUsernameThatStartsWith0xButDoesNotUseHexChars() (gas: 374333)
UsernameRegistrarRegisterTest:testShouldNotSlashUsernameThatStartsWith0xButIsSmallerThan12() (gas: 373775)
UsernameRegistrarRegisterTest:testShouldNotSlashValidUsername() (gas: 377392)
UsernameRegistrarRegisterTest:testSlashAddressLikeUsername() (gas: 387824)
UsernameRegistrarRegisterTest:testSlashInvalidUsername() (gas: 427093)
UsernameRegistrarRegisterTest:testSlashSmallUsername() (gas: 388158)
UsernameRegistrarRegisterTest:testUpdateAccountOwner() (gas: 3958584)
UsernameRegistrarRegisterTest:testUpdateRegistryPrice() (gas: 21924)
UsernameRegistrarRegisterTest:testUser() (gas: 2404)
UsernameRegistrarTest:testDeployment() (gas: 44066)
UsernameRegistrarTest:testUser() (gas: 2359)
4 changes: 3 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
*.sol linguist-language=Solidity
lib/** linguist-vendored

* text=auto eol=lf
11 changes: 11 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## Description

Describe the changes made in your pull request here.

## Checklist

Ensure you completed **all of the steps** below before submitting your pull request:

- [ ] Added natspec comments?
- [ ] Ran `pnpm adorno`?
- [ ] Ran `pnpm verify`?
18 changes: 18 additions & 0 deletions .github/workflows/add-issue-to-project-board.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Add issue to task board

on:
issues:
types:
- opened

jobs:
add-to-project:
name: Add to task board
runs-on: ubuntu-latest
steps:
- uses: actions/add-to-project@v0.5.0
with:
# You can target a project in a different organization
# to the issue
project-url: https://github.com/orgs/vacp2p/projects/10
github-token: ${{ secrets.ADD_TO_VAC_BOARD_PAT }}
18 changes: 18 additions & 0 deletions .github/workflows/add-pr-to-project-board.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Add PR task board

on:
pull_request:
types:
- opened

jobs:
add-to-project:
name: Add to task board
runs-on: ubuntu-latest
steps:
- uses: actions/add-to-project@v0.5.0
with:
# You can target a project in a different organization
# to the issue
project-url: https://github.com/orgs/vacp2p/projects/10
github-token: ${{ secrets.ADD_TO_VAC_BOARD_PAT }}
Loading
Loading