Skip to content

Commit

Permalink
Deprecate RestrictedNORI (#734)
Browse files Browse the repository at this point in the history
* original gas snapshot

* new snapshot

* widespread removal, fix outdate vesting task

* cleanup, test fixes

* slither triage

* snapshot

---------

Co-authored-by: amiecorso <amie@nori.com>
  • Loading branch information
amiecorso and amiecorso authored Mar 7, 2024
1 parent 447f6fb commit 7a03b43
Show file tree
Hide file tree
Showing 44 changed files with 428 additions and 4,251 deletions.
236 changes: 108 additions & 128 deletions .gas-snapshot

Large diffs are not rendered by default.

63 changes: 26 additions & 37 deletions .gas-snapshot-production
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ UInt256ArrayLib_sum:test_library_overflow() (gas: 3613)
UInt256ArrayLib_sum:test_reference() (gas: 22196)
BridgedPolygonNORI_name:test() (gas: 16637)
BridgedPolygonNORI_permit:test() (gas: 91823)
Certificate__msgSenderERC721A:test() (gas: 1049)
Certificate**msgSenderERC721A:test() (gas: 1049)
Certificate_approve:test() (gas: 17625)
Certificate_burn:test() (gas: 183333)
Certificate_burn:test_reverts_when_paused() (gas: 54328)
Expand All @@ -39,23 +39,23 @@ LockedNORITest:testReentryTokensToSend() (gas: 1074281)
LockedNORITest:testTokensReceivedReverts() (gas: 68683)
LockedNORILib_availableAmount:test() (gas: 11685)
Market_ALLOWLIST_ROLE:test() (gas: 12690)
Market__addActiveRemoval:test() (gas: 182871)
Market__addActiveRemoval:test__lis2VintagesFor1SupplierFor2SubIdentifiers() (gas: 241002)
Market__addActiveRemoval:test__list1VintageFor1Supplier() (gas: 186028)
Market__addActiveRemoval:test__list1VintageFor2Suppliers() (gas: 359089)
Market__addActiveRemoval:test__list2VintagesFor1SupplierFor1SubIdentifier() (gas: 259259)
Market__isAuthorizedWithdrawal_false:test_returnsFalseWhenAllConditionsAreFalse() (gas: 7323)
Market__isAuthorizedWithdrawal_true:test_returnsTrueWhenMsgSenderEqualsOwner() (gas: 655)
Market__isAuthorizedWithdrawal_true:test_returnsTrueWhenMsgSenderHasDefaultAdminRole() (gas: 96769)
Market__isAuthorizedWithdrawal_true:test_returnsTrueWhenMsgSenderIsApprovedForAll() (gas: 9032)
Market__multicall_empty_bytes_reverts:test() (gas: 19379)
Market__multicall_initialize_reverts:test() (gas: 34233)
Market__validatePrioritySupply:test_supplyAfterPurchaseIsLessThanPriorityRestrictedThreshold() (gas: 3150)
Market__validatePrioritySupply:test_supplyAfterPurchaseIsZero() (gas: 3034)
Market__validatePrioritySupply_buyerIsAllowlistedAndAmountExceedsPriorityRestrictedThreshold:test() (gas: 5431)
Market__validatePrioritySupply_reverts_LowSupplyAllowlistRequired:test() (gas: 8339)
Market__validateSupply:test() (gas: 1066)
Market__validateSupply:test_reverts_OutOfSupply() (gas: 3847)
Market**addActiveRemoval:test() (gas: 182871)
Market**addActiveRemoval:test**lis2VintagesFor1SupplierFor2SubIdentifiers() (gas: 241002)
Market**addActiveRemoval:test**list1VintageFor1Supplier() (gas: 186028)
Market**addActiveRemoval:test**list1VintageFor2Suppliers() (gas: 359089)
Market**addActiveRemoval:test**list2VintagesFor1SupplierFor1SubIdentifier() (gas: 259259)
Market**isAuthorizedWithdrawal_false:test_returnsFalseWhenAllConditionsAreFalse() (gas: 7323)
Market**isAuthorizedWithdrawal_true:test_returnsTrueWhenMsgSenderEqualsOwner() (gas: 655)
Market**isAuthorizedWithdrawal_true:test_returnsTrueWhenMsgSenderHasDefaultAdminRole() (gas: 96769)
Market**isAuthorizedWithdrawal_true:test_returnsTrueWhenMsgSenderIsApprovedForAll() (gas: 9032)
Market**multicall_empty_bytes_reverts:test() (gas: 19379)
Market**multicall_initialize_reverts:test() (gas: 34233)
Market**validatePrioritySupply:test_supplyAfterPurchaseIsLessThanPriorityRestrictedThreshold() (gas: 3150)
Market**validatePrioritySupply:test_supplyAfterPurchaseIsZero() (gas: 3034)
Market**validatePrioritySupply_buyerIsAllowlistedAndAmountExceedsPriorityRestrictedThreshold:test() (gas: 5431)
Market**validatePrioritySupply_reverts_LowSupplyAllowlistRequired:test() (gas: 8339)
Market**validateSupply:test() (gas: 1066)
Market**validateSupply:test_reverts_OutOfSupply() (gas: 3847)
Market_getActiveSuppliers:test_1_supplier() (gas: 606278)
Market_getActiveSuppliers:test_3_suppliers() (gas: 1251614)
Market_getActiveSuppliers:test_no_suppliers() (gas: 21300)
Expand All @@ -79,14 +79,14 @@ Market_withdraw_as_DEFAULT_ADMIN_ROLE:test() (gas: 268736)
Market_withdraw_as_operator:test() (gas: 278426)
Market_withdraw_as_supplier:test() (gas: 267128)
Market_withdraw_reverts:test() (gas: 134049)
Removal__beforeTokenTransfer:test() (gas: 17731)
Removal__beforeTokenTransfer:test_paused_reverts_Paused() (gas: 30218)
Removal__createRemovalData:test() (gas: 23318)
Removal__createRemovalData:test_reverts_InvalidData() (gas: 26167)
Removal__createRemovalDataBatch:test() (gas: 30694)
Removal__createRemovalDataBatch:test_reverts_InvalidData2() (gas: 37786)
Removal__validateRemoval:test() (gas: 3295)
Removal__validateRemoval:test_reverts_InvalidData() (gas: 5953)
Removal**beforeTokenTransfer:test() (gas: 17731)
Removal**beforeTokenTransfer:test_paused_reverts_Paused() (gas: 30218)
Removal**createRemovalData:test() (gas: 23318)
Removal**createRemovalData:test_reverts_InvalidData() (gas: 26167)
Removal**createRemovalDataBatch:test() (gas: 30694)
Removal**createRemovalDataBatch:test_reverts_InvalidData2() (gas: 37786)
Removal**validateRemoval:test() (gas: 3295)
Removal**validateRemoval:test_reverts_InvalidData() (gas: 5953)
Removal_addBalance:test() (gas: 58459)
Removal_addBalance_reverts_RemovalNotYetMinted:test() (gas: 32909)
Removal_batchGetHoldbackPercentages_multipleIds:test() (gas: 11721)
Expand Down Expand Up @@ -133,17 +133,6 @@ RemovalQueue_getTotalBalanceFromRemovalQueue:test_100xRemovalsOfTheDifferentVint
RemovalQueue_getTotalBalanceFromRemovalQueue:test_100xRemovalsOfTheSameVintage() (gas: 610255)
RemovalQueue_insertRemovalByVintage:test_insertRemovalOnce() (gas: 118507)
RemovalQueue_insertRemovalByVintage:test_insertRemovalTwice() (gas: 119604)
RestrictedNORI__validateSchedule:test_startTimeNotZero() (gas: 503)
RestrictedNORI__validateSchedule_reverts:test_restrictionDurationZero() (gas: 3736)
RestrictedNORI__validateSchedule_reverts:test_startTimeZero() (gas: 3252)
RestrictedNORI_createSchedule:test() (gas: 44087)
RestrictedNORI_initialize:test() (gas: 21382)
RestrictedNORI_linearReleaseAmountAvailable:test() (gas: 12181)
RestrictedNORI_revokeUnreleasedTokens:test() (gas: 208397)
RestrictedNORI_scheduleExists:test() (gas: 15510)
RestrictedNORI_scheduleExists:test_doesntExist() (gas: 15411)
RestrictedNORI_transfers_revert:testSafeBatchTransferFromReverts() (gas: 28800)
RestrictedNORI_transfers_revert:testSafeTransferFromReverts() (gas: 24003)
Checkout_buyingFromOneRemoval:test() (gas: 681519)
Checkout_buyingFromTenRemovals:test() (gas: 1805323)
Checkout_buyingFromTenRemovals_singleSupplier:test() (gas: 1794451)
Expand Down
2 changes: 0 additions & 2 deletions config/docgen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ export const docgen: HardhatUserConfig['docgen'] = {
'LockedNORILib',
'RemovalsByYearLib',
'RemovalIdLib',
'RestrictedNORI',
'RestrictedNORILib',
].includes((item as any)?.canonicalName)
? (item as any)?.canonicalName?.concat('.md')
: (item as any)?.nodeType === 'ErrorDefinition'
Expand Down
22 changes: 5 additions & 17 deletions contracts.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"hardhat": {
"NORI": {
"proxyAddress": "0xcb3a9Df3363315fb6E190A77C9421ecc6a92cfF0"
"proxyAddress": "0x3C5d3e20ab495ecee10b4E6eeAd04Dd21d780b98"
},
"BridgedPolygonNORI": {
"proxyAddress": "0xbF1134A069430ED15FC6AA4Ba7563ca340213eb6"
Expand All @@ -13,25 +13,22 @@
"proxyAddress": "0x2CA5C6C765be11F44519Fc85Bf758723DC3C8cFC"
},
"Market": {
"proxyAddress": "0xA85991C70a743ffcE508b2E520C685C9d8ea6F4d"
"proxyAddress": "0xb4c857d57b7130F033159958B5af4Fa3Bd0a04c6"
},
"LockedNORI": {
"proxyAddress": "0x2AE26a38Bc11CE4FdfCaf0431D5a708b17E0dD99"
"proxyAddress": "0x0013B38Ffb2EA257427F5d3D5cb1af53e8AF8aC0"
},
"ScheduleTestHarness": {
"proxyAddress": "0x83207e4a2caC1015bda1A794b57F708C4360924e"
},
"RemovalTestHarness": {
"proxyAddress": "0x8f9a093Ef35A1aa1E4103Ce3DbbE1197504c3ed4"
"proxyAddress": "0x1BE70016d4D5144124f77DDaB7504ea33d173C03"
},
"MockCertificate": {
"proxyAddress": "0x3C5d3e20ab495ecee10b4E6eeAd04Dd21d780b98"
},
"RestrictedNORI": {
"proxyAddress": "0xb4c857d57b7130F033159958B5af4Fa3Bd0a04c6"
},
"NoriUSDC": {
"proxyAddress": "0xEdf0bef28943aE9d2ee7d84cF1AEEC85588655b7"
"proxyAddress": "0xd3561A044a740D07487f07b1236558574a8d0974"
}
},
"localhost": {
Expand All @@ -52,9 +49,6 @@
},
"LockedNORI": {
"proxyAddress": "0xCcFfFA6c2a030821331cC113b63babDC60BfF82A"
},
"RestrictedNORI": {
"proxyAddress": "0x24E4278838f30fCF2acfC722c5724b2154d456Ca"
}
},
"polygon": {
Expand All @@ -72,9 +66,6 @@
},
"LockedNORI": {
"proxyAddress": "0xCcFfFA6c2a030821331cC113b63babDC60BfF82A"
},
"RestrictedNORI": {
"proxyAddress": "0x3A2A50FC8Df737b83671775e73dD80347dE4a4fa"
}
},
"mainnet": {
Expand All @@ -100,9 +91,6 @@
},
"LockedNORI": {
"proxyAddress": "0xCdcB43CB7B668F0C1cA04FE4b60DA7F8C62Be393"
},
"RestrictedNORI": {
"proxyAddress": "0x44AD2d93B6790c750FD171Cb2872cC12cE025eBd"
}
},
"goerli": {
Expand Down
6 changes: 0 additions & 6 deletions contracts/IMarket.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,4 @@ interface IMarket {
* @param removalId The ID of the removal to release.
*/
function release(uint256 removalId) external;

/**
* @notice Get the RestrictedNORI contract address.
* @return Returns the address of the RestrictedNORI contract.
*/
function getRestrictedNoriAddress() external view returns (address);
}
2 changes: 1 addition & 1 deletion contracts/IRemoval.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pragma solidity =0.8.17;

interface IRemoval {
/**
* @notice Get the project ID (which is the removal's schedule ID in RestrictedNORI) for a given removal ID.
* @notice Get the project ID for a given removal ID.
* @param id The removal token ID for which to retrieve the project ID.
* @return The project ID for the removal token ID.
*/
Expand Down
Loading

0 comments on commit 7a03b43

Please sign in to comment.