tokamak-network / ton-staking-v2

11 stars 3 forks source link

Additional DAO changes #34

Closed zzooppii closed 1 month ago

zzooppii commented 3 months 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 3 months 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 3 months ago

registerLayer2CandidateByOwner Test

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

zzooppii commented 3 months 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 2 months 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