Skip to content

Commit

Permalink
Merge pull request #34 from lidofinance/voting-manager
Browse files Browse the repository at this point in the history
Simple Delegation
  • Loading branch information
katamarinaki authored Dec 19, 2024
2 parents b09834d + a059505 commit a7d0e33
Show file tree
Hide file tree
Showing 13 changed files with 2,681 additions and 467 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/verify-bytecode.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ jobs:
- name: Install nodejs
uses: actions/setup-node@v3
with:
node-version: 14
node-version: 18

- name: Install dependencies
run: yarn

- name: Compile contracts
run: >
jq -r '.scripts?.compile | strings | input_filename' apps/*/package.json |
jq -r '.scripts?.compile | select(contains("hardhat")) | input_filename' apps/*/package.json |
xargs dirname | xargs -I% sh -c "echo % && cd % && yarn compile"
- name: Verify bytecode of contracts
Expand Down
8 changes: 8 additions & 0 deletions apps/voting/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# IDE Settings
.vscode

# Local dev config
accounts.json

# Local artifacts
tx-deploy-voting_for_upgrade.json
15 changes: 14 additions & 1 deletion apps/voting/accounts.sample.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,23 @@
"projectId": "INFURA_PROJECT_ID"
},
"etherscan": {
"apiKey": "ETHERSCAN_API_KEY"
"apiKey": "ETHERSCAN_API_KEY",
"customChains": [
{
"network": "holesky",
"chainId": 17000,
"urls": {
"apiURL": "https://api-holesky.etherscan.io/api",
"browserURL": "https://holesky.etherscan.io"
}
}
]
},
"infura_ipfs": {
"projectId": "",
"projectSecret": ""
},
"drpc": {
"key": "DRPC_KEY"
}
}
468 changes: 383 additions & 85 deletions apps/voting/contracts/Voting.sol

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/voting/contracts/test/mocks/VotingMock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ contract VotingMock is Voting, TimeHelpersMock {
token.generateTokens(_holder, _tokenAmount);

bytes memory noScript = new bytes(0);
voteId = _newVote(noScript, _metadata, false);
voteId = _newVote(noScript, _metadata);
emit StartVote(voteId, msg.sender, _metadata);
}
}
13 changes: 10 additions & 3 deletions apps/voting/hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ const ETH_ACCOUNT_NAME = process.env.ETH_ACCOUNT_NAME
const accounts = readJson(`./accounts.json`) || {
eth: { dev: 'remote' },
etherscan: { apiKey: undefined },
infura: { projectId: undefined }
infura: { projectId: undefined },
drpc: {key: undefined},
}

const getNetConfig = (networkName, ethAccountName) => {
Expand All @@ -39,9 +40,9 @@ const getNetConfig = (networkName, ethAccountName) => {
dev,
hardhat: {
blockGasLimit: 20000000,
hardfork: 'cancun',
accounts: {
mnemonic: 'hardhat',
count: 20,
count: 500,
accountsBalance: '100000000000000000000000',
gasPrice: 0
}
Expand All @@ -64,6 +65,12 @@ const getNetConfig = (networkName, ethAccountName) => {
chainId: 1,
timeout: 60000 * 10
},
holesky: {
...base,
url: 'https://lb.drpc.org/ogrpc?network=holesky&dkey=' + accounts.drpc.key,
chainId: 17000,
timeout: 60000 * 10
}
}
const netConfig = byNetName[networkName]
return netConfig ? { [networkName]: netConfig } : {}
Expand Down
15 changes: 8 additions & 7 deletions apps/voting/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,22 @@
"@aragon/os": "4.4.0"
},
"devDependencies": {
"patch-package": "^6.4.7",
"@aragon/contract-helpers-test": "^0.1.0",
"@aragon/hardhat-aragon": "^1.0.0",
"@aragon/hardhat-config": "^1.0.1",
"@nomicfoundation/hardhat-network-helpers": "^1.0.10",
"@nomiclabs/hardhat-ethers": "^2.0.2",
"@nomiclabs/hardhat-etherscan": "^3.1.8",
"@nomiclabs/hardhat-ganache": "^2.0.1",
"@nomiclabs/hardhat-truffle5": "^2.0.5",
"@nomiclabs/hardhat-web3": "^2.0.0",
"@nomiclabs/hardhat-ethers": "^2.0.2",
"@nomiclabs/hardhat-etherscan": "^2.1.6",
"hardhat-abi-exporter": "^2.8.0",
"hardhat-gas-reporter": "^1.0.8",
"chai": "^4.2.0",
"ethers": "^5.4.7",
"hardhat": "^2.6.5",
"solidity-coverage": "^0.7.9",
"hardhat": "^2.22.2",
"hardhat-abi-exporter": "^2.8.0",
"hardhat-gas-reporter": "^2.1.1",
"patch-package": "^6.4.7",
"solidity-coverage": "^0.8.0",
"solium": "^1.2.5",
"web3": "^1.3.0"
}
Expand Down
Loading

0 comments on commit a7d0e33

Please sign in to comment.