tokamak-network / ton-staking-v2

6 stars 1 forks source link

Additional DAO changes #34

Open zzooppii opened 1 month ago

zzooppii commented 1 month ago

A vulnerability was found in DAO AgendaManagerContract, so it was changed to disable the vulnerability and additionally, there was a policy change for the registerLayer2Candidate function.

Logic changes

Test

zzooppii commented 1 month ago

If the atomicExecute variable is set to False when creating an agenda, the agenda creation will be rejected.

Test : npx hardhat test test/agenda/17.atomicExecuteAgendaTest-mainnet.js

zzooppii commented 1 month ago

registerLayer2CandidateByOwner Test

Test : npx hardhat test test/agenda/18.Layer2CandidateTest-mainnet.js

zzooppii commented 3 weeks ago

check what change on updated StakeV2.5

DAOCommitteeOwner change

  1. function name change setLayer2CandidateFactory -> setCandidateAddOnFactory
  2. storage name change layer2CandidateFactory -> candidateAddOnFactory
  3. function change setTargetSetL2Registry -> setTargetSetL1BridgeRegistry

DAOCommittee_V1 change

  1. function change createLayer2Candidate -> createCandidateAddOn
  2. interface name change ILayer2CandidateFactory -> ICandidateAddOnFactory
zzooppii commented 1 week ago

How to Test

  1. change the hardhat.config.ts

    • change forking using the url sepolia
  2. enter cli

    • npx hardhat test test/agenda/19.ChangeName-test-sepolia.js