Eric 92537a5120
fix(slot reservations): clear AddressSet instead of delete (#235)
* fix(slot-reservations): Allows slot to be reserved when in repair

Previous to when SlotState.Repair was implemented, slots in repair would be considered free and the slots could be reserved in this state. Now that SlotState.Repair has been implemented, the `canReserveSlot` needs to check that the SlotState is in Repair or is Free before allowing reservation.

* fix(slot reservations): clear AddressSet instead of delete

Deleting an AddressSet causes corrupted memory. Each address must be removed individually, which is OK to do since there is a maxReservations parameter that keeps this number small.

https://docs.openzeppelin.com/contracts/5.x/api/utils#EnumerableSet

* Switch to EnumerableSet clear function provided by openzeppelin

---------

Co-authored-by: Arnaud <arnaud@status.im>
2025-05-15 11:40:14 +10:00

33 lines
1.2 KiB
JSON

{
"name": "codex-contracts-eth",
"license": "MIT",
"scripts": {
"test": "npm run lint && hardhat test",
"fuzz": "hardhat compile && fuzzing/fuzz.sh",
"start": "hardhat node --export deployment-localhost.json",
"compile": "hardhat compile",
"format": "prettier --write contracts/*.sol contracts/**/*.sol test/**/*.js",
"format:check": "prettier --check contracts/*.sol contracts/**/*.sol test/**/*.js",
"lint": "solhint contracts/**.sol",
"deploy": "hardhat deploy",
"verify": "npm run verify:marketplace && npm run verify:state_changes",
"verify:marketplace": "certoraRun certora/confs/Marketplace.conf",
"verify:state_changes": "certoraRun certora/confs/StateChanges.conf"
},
"devDependencies": {
"@nomiclabs/hardhat-ethers": "^2.2.1",
"@nomiclabs/hardhat-waffle": "^2.0.3",
"@openzeppelin/contracts": "^5.3.0",
"@stdlib/stats-binomial-test": "^0.0.7",
"chai": "^4.3.7",
"ethereum-waffle": "^3.4.4",
"ethers": "^5.7.2",
"hardhat": "^2.17.1",
"hardhat-deploy": "^0.11.34",
"hardhat-deploy-ethers": "^0.3.0-beta.13",
"prettier": "^2.8.2",
"prettier-plugin-solidity": "^1.4.2",
"solhint": "^5.0.5"
}
}