Skip to content

Commit

Permalink
v5, add deployment for TreasuryBuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
jac18281828 committed Jul 6, 2023
1 parent f1c06b3 commit 504d535
Show file tree
Hide file tree
Showing 9 changed files with 223 additions and 676 deletions.
1 change: 1 addition & 0 deletions .github/workflows/testnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,4 @@ jobs:
echo "Using library ${DEPLOYED_LIBRARY}"
BUILDER_ADDRESS=0xa36e161361A16D75534d565480e62cE474BaC9f3 forge script ./script/DeployCommunityBuilder.sol --sig 'upgrade()' --libraries ${DEPLOYED_LIBRARY} --slow --broadcast --rpc-url ${RPC_URL} --private-key ${PRIVATE_KEY}
BUILDER_ADDRESS=0x9fB5a925E61c31617129B5D030808939DADA99f7 forge script ./script/DeployCollective.sol --sig 'upgrade()' --libraries ${DEPLOYED_LIBRARY} --slow --broadcast --rpc-url ${RPC_URL} --private-key ${PRIVATE_KEY}
ECDSA_LIB_ADDRESS=0xe9e21aaEaEad9c57C1F4c622915fFB54f9Ebe338 forge script ./script/DeployTreasuryBuilder.sol --sig 'deploy()' --libraries ./lib/openzeppelin-contracts/contracts/utils/cryptography/ECDSA.sol:ECDSA:${ECDSA_LIB_ADDRESS} --libraries contracts/Constant.sol:Constant:${CONSTANT_LIB_ADDRESS} --slow --broadcast --rpc-url ${RPC_URL} --private-key ${PRIVATE_KEY}
1 change: 1 addition & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
path = lib/openzeppelin-contracts
url = https://github.com/OpenZeppelin/openzeppelin-contracts
branch = v4.9.2

2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ RUN yarn hint
RUN FOUNDRY_PROFILE=fastbuild forge test -vvv --fail-fast
RUN forge geiger --check contracts/*

RUN bin/update_abi.sh

2 changes: 1 addition & 1 deletion contracts/Constant.sol
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ library Constant {
uint256 public constant MAXIMUM_REBATE_BASE_FEE = 200 gwei;

/// software versions
uint32 public constant CURRENT_VERSION = 4;
uint32 public constant CURRENT_VERSION = 5;

/// @notice Compute the length of any string in solidity
/// @dev This method is expensive and is used only for validating
Expand Down
4 changes: 2 additions & 2 deletions contracts/storage/GovernanceStorage.sol
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ contract GovernanceStorage is Storage, VersionedContract, ERC165, ReentrancyGuar
requireShareAvailable(_proposalId, _wallet, _shareId)
requireVotingActive(_proposalId)
requireUpDownVote(_proposalId)
nonReentrant
nonReentrant
returns (uint256)
{
uint256 _shareCount = _voterClass.confirm(_wallet, _shareId);
Expand Down Expand Up @@ -669,7 +669,7 @@ contract GovernanceStorage is Storage, VersionedContract, ERC165, ReentrancyGuar
requireValid(_proposalId)
requireShareAvailable(_proposalId, _wallet, _shareId)
requireVotingActive(_proposalId)
nonReentrant
nonReentrant
returns (uint256)
{
uint256 _shareCount = _voterClass.confirm(_wallet, _shareId);
Expand Down
4 changes: 2 additions & 2 deletions contracts/treasury/Treasury.sol
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@ contract Treasury is Vault, ReentrancyGuard {
/// seconds of the eventual schedule time. An approval may be possible to 'replay' and
/// succeed prior to that time. Later, any replay approval would fail the timelock constraints.
///
/// It is advisable to schedule all transactions at or near TIMELOCK_MINIMUM_DELAY.
/// A grace of a few minutes might be useful to ensure transactions complete safely, but the
/// It is advisable to schedule all transactions at or near TIMELOCK_MINIMUM_DELAY.
/// A grace of a few minutes might be useful to ensure transactions complete safely, but the
/// operator should be aware of these timings and careful that cancellations are timely.
/// @param _to the approved recipient
function cancel(address _to) public requireApprover {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
"url": "git+https://github.com/collectivexyz/collective-governance-v1.git"
},
"devDependencies": {
"solhint": "3.3.8",
"prettier": "2.8.3",
"solhint": "3.4.1",
"prettier": "2.8.8",
"prettier-plugin-solidity": "1.1.3"
},
"dependencies": {
Expand Down
5 changes: 5 additions & 0 deletions test/treasury/Treasury.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,11 @@ contract TreasuryTest is Test {
assertEq(_treasury.balance(), 13 ether);
}

function testBalanceForNobodyIsZero() public {
assertEq(20 ether, _treasury.balance());
assertEq(_treasury.balance(_DENIZEN1), 0 ether);
}

function testBalanceRestoredOnCancellation() public {
assertEq(20 ether, _treasury.balance());
vm.prank(_APP1);
Expand Down
Loading

0 comments on commit 504d535

Please sign in to comment.