diff --git a/dao/.gitignore b/dao/.gitignore index 85198aa..2c2cde2 100644 --- a/dao/.gitignore +++ b/dao/.gitignore @@ -12,3 +12,6 @@ docs/ # Dotenv file .env + +#lib +lib/ diff --git a/dao/src/SuperfluidDao.sol b/dao/src/SuperfluidDao.sol index fb2524b..63499aa 100644 --- a/dao/src/SuperfluidDao.sol +++ b/dao/src/SuperfluidDao.sol @@ -116,7 +116,7 @@ contract SuperfluidDao is ISuperfluidDao { _proposals[proposalId].voteAgainst += voteWeight; _votes[msg.sender][proposalId] = VoteStatus.VotedAgainst; } - + _superfluidToken.burn(msg.sender, 1); emit CastVote(msg.sender, proposalId, voteWeight); diff --git a/dao/src/SuperfluidDaoToken.sol b/dao/src/SuperfluidDaoToken.sol index 0b1aa1b..a8fa7e9 100644 --- a/dao/src/SuperfluidDaoToken.sol +++ b/dao/src/SuperfluidDaoToken.sol @@ -1,11 +1,9 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity ^0.8.13; +// SPDX-License-Identifier: AGPLv3 +pragma solidity ^0.8.0; -import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; -import { ISuperfluid } from "@superfluid-finance/packages/ethereum-contracts/contracts/interfaces/superfluid/ISuperfluid.sol"; -import { IConstantFlowAgreementV1 } from "@superfluid-finance/packages/ethereum-contracts/contracts/interfaces/agreements/IConstantFlowAgreementV1.sol"; -import { ISuperToken } from "@superfluid-finance/packages/ethereum-contracts/contracts/interfaces/superfluid/ISuperToken.sol"; -import { ISuperfluidToken } from "@superfluid-finance/packages/ethereum-contracts/contracts/interfaces/superfluid/ISuperfluidToken.sol"; +import {SuperTokenBase} from "../custom-supertokens/contracts/base/SuperTokenBase.sol"; + +address constant SUPER_TOKEN_FACTORY = 0x0422689cc4087b6B7280e0a7e7F655200ec86Ae1; contract SuperfluidAdmin { address private _admin; @@ -24,19 +22,13 @@ contract SuperfluidAdmin { } } -contract SuperfluidDaoToken is ERC20, SuperfluidAdmin { - - // ISuperfluid private _host; // Contrat hôte Superfluid - // IConstantFlowAgreementV1 private _cfa; // Contrat d'accord de flux constant - // ISuperToken private _superToken; // Contrat Super Token +contract SuperfluidDaoToken is SuperfluidAdmin { - constructor() ERC20("SuperfluidDaoToken", "SFT") SuperfluidAdmin() { - // _host = ISuperfluid(msg.sender) - // _cfa = IConstantFlowAgreementV1(); - // _superToke + constructor() { + _initialize(SUPER_TOKEN_FACTORY, "SuperfluidDaoToken", "SDT"); } - function mint(address to, uint256 amount) public onlyAdmin { + function mint(address to, uint256 amount) public onlyAdmin { _mint(to, amount); } diff --git a/dao/test/SuperfluidDao.t.sol b/dao/test/SuperfluidDao.t.sol index c700fe9..fb1d90c 100644 --- a/dao/test/SuperfluidDao.t.sol +++ b/dao/test/SuperfluidDao.t.sol @@ -113,9 +113,7 @@ contract SuperfluidDaoTest is Test { Dao.postProposal("Donnez moins d'argent a Isma", 1); Dao.vote(0, true); ISuperfluidDao.Proposal memory proposal = Dao.getProposal(0); - - while (block.timestamp >= proposal.dueDate) - + vm.warp(proposal.dueDate + 1); Dao.executeProposal(0); vm.stopPrank(); }