Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Final refactor to dxdao gov 1.5 contracts #216

Merged
Merged
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
4e8acf7
refactor(contracts): finally remove daostack contracts
AugustoL Sep 19, 2022
fc9170d
refactor(contracts): remove not needed DxToken
AugustoL Sep 19, 2022
7feaecc
refactor(contracts): move dxvote utils to utils folder
AugustoL Sep 19, 2022
15e7a6b
refactor(contracts): remove unnecesary DaoCreator and upgrade RealMat…
AugustoL Sep 19, 2022
557dc16
refactor(contracts): refactor and reorder of Gov 1.5 contracts
AugustoL Sep 19, 2022
0942d3f
fix(scripts): small change in deploy scripts just to compile for tests
AugustoL Sep 19, 2022
e7503ef
refactor(tests): refactor helpers to woek with new dao contracts
AugustoL Sep 19, 2022
dcfe01b
refactor(contracts/dxdao): rename Dx contracts to DAO contracts
AugustoL Sep 20, 2022
16512f8
refactor(contracts/dao): contracts renamed form dxdao to dao and plac…
AugustoL Sep 22, 2022
3e15a7d
test(dao): tests renamed and placed in folders matching contracts
AugustoL Sep 22, 2022
f44b23e
chore(package.json): some dependencies updated
AugustoL Sep 22, 2022
9ada690
refactor(contracts): use solc 0.8.17, removed not needed contracts, c…
AugustoL Sep 22, 2022
c33d195
test(all): remove deleted contracts, do some changes to get most of t…
AugustoL Sep 22, 2022
7e10cb6
refactor(contracts/dao/schemes): refactor WalletScheme into Scheme, W…
AugustoL Sep 22, 2022
9eb873a
test(walletschemes): remove doAvatarGenericCalls parameter from Walle…
AugustoL Sep 22, 2022
c627996
fix deployment script
MiltonTulli Sep 22, 2022
0826077
fix: fixed WalletScheme test - proposal to change max proposal time
dcrescimbeni Sep 23, 2022
e9aa693
fix: fixed test MasterWalletScheme - proposal to change max proposal …
dcrescimbeni Sep 23, 2022
fc19269
feat(contracts/dao): dAOController now keeps track of active/inactive…
AugustoL Sep 23, 2022
b10d5f4
test(dao): check active/inactive proposals in DAOController
AugustoL Sep 23, 2022
4fa9a75
feat: ownership of REP is now transferred to controller instead of av…
dcrescimbeni Sep 23, 2022
bc5a489
Merge branch 'gov-1-5-contracts' of github.com:AugustoL/dxdao-contrac…
AugustoL Sep 23, 2022
28a3edb
refactor(contracts/dao): rename daoreputation in DAOController and ad…
AugustoL Sep 23, 2022
5f4e803
fix(contracts/dao): walletScheme option 2 is rejected and dont execut…
AugustoL Sep 23, 2022
127c3de
test: fixed tests
dcrescimbeni Sep 23, 2022
1cd82ac
fix: switched checks for executionTimeout and winningOption being the…
dcrescimbeni Sep 23, 2022
037dad4
fix(contracts/dao): remove check of permissions allowed for registeri…
AugustoL Sep 23, 2022
98893ba
fix(contracts/dao): remove not necessary _avatar parameter for unregi…
AugustoL Sep 23, 2022
ca13065
refactor(contracts/dao): take in count all proposed calls for option 1
AugustoL Sep 23, 2022
e6fb365
test(dao): update name of main variables used for dao tests and fixed…
AugustoL Sep 23, 2022
749a9d4
refactor(contracts/dao): final refactor to Schemes contracts
AugustoL Sep 25, 2022
6027872
feat(hardhat): add viaIR compiler setting to improve compile optimiza…
AugustoL Sep 25, 2022
12142f8
refactor(contracts/dao): remove staking token callbacks and let votin…
AugustoL Sep 25, 2022
786da34
test(test/all): change test helpers and test cases to work with new c…
AugustoL Sep 26, 2022
b774b1e
Merge branch 'gov-1-5-contracts' of github.com:AugustoL/dxdao-contrac…
AugustoL Sep 26, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test(dao): check active/inactive proposals in DAOController
AugustoL committed Sep 23, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit b10d5f4dde0fccca4d170dac22e49114027d9f9e
25 changes: 19 additions & 6 deletions test/dao/dxdao.js
Original file line number Diff line number Diff line change
@@ -8,8 +8,7 @@ const ERC20Mock = artifacts.require("./ERC20Mock.sol");

contract("DXdao", function (accounts) {
const constants = helpers.constants;
let dxDao;
let proposalId;
let dxDao, proposalId, masterAvatarScheme;

beforeEach(async function () {
const votingMachineToken = await ERC20Mock.new(
@@ -97,9 +96,9 @@ contract("DXdao", function (accounts) {
true
);

const masterWalletScheme = await AvatarScheme.new();
masterAvatarScheme = await AvatarScheme.new();

await masterWalletScheme.initialize(
await masterAvatarScheme.initialize(
dxDao.avatar.address,
dxDao.votingMachine.address,
dxDao.controller.address,
@@ -110,13 +109,13 @@ contract("DXdao", function (accounts) {
);

await dxDao.controller.registerScheme(
masterWalletScheme.address,
masterAvatarScheme.address,
paramsHash,
true,
true
);

const createProposalTx = await masterWalletScheme.proposeCalls(
const createProposalTx = await masterAvatarScheme.proposeCalls(
[accounts[1], accounts[1]],
["0x0", "0x0"],
[10, 5],
@@ -126,6 +125,10 @@ contract("DXdao", function (accounts) {
);

proposalId = createProposalTx.logs[0].args._proposalId;

const activeProposals = await dxDao.controller.getActiveProposals();
assert.equal(activeProposals[0].proposalId, proposalId);
assert.equal(activeProposals[0].scheme, masterAvatarScheme.address);
});

it.skip("Deploy DXvote", function (done) {
@@ -152,6 +155,11 @@ contract("DXdao", function (accounts) {
await dxDao.votingMachine.vote(proposalId, 1, 0, constants.NULL_ADDRESS, {
from: accounts[2],
});

const inactiveProposals = await dxDao.controller.getInactiveProposals();
assert.equal(inactiveProposals[0].proposalId, proposalId);
assert.equal(inactiveProposals[0].scheme, masterAvatarScheme.address);
assert.deepEqual(await dxDao.controller.getActiveProposals(), []);
assert.equal(await web3.eth.getBalance(dxDao.avatar.address), "90");
});

@@ -161,6 +169,11 @@ contract("DXdao", function (accounts) {
await dxDao.votingMachine.vote(proposalId, 2, 0, constants.NULL_ADDRESS, {
from: accounts[2],
});

const inactiveProposals = await dxDao.controller.getInactiveProposals();
assert.equal(inactiveProposals[0].proposalId, proposalId);
assert.equal(inactiveProposals[0].scheme, masterAvatarScheme.address);
assert.deepEqual(await dxDao.controller.getActiveProposals(), []);
assert.equal(await web3.eth.getBalance(dxDao.avatar.address), "95");
});
});