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

[feat] Proposal vote check #6

Merged
merged 8 commits into from
Jan 4, 2024
Merged
Changes from 1 commit
Commits
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
πŸ› put owner in init params instead msg.sender
✨ setCouncilMembers func added
✨ setBasisStakedAmount func added
kamikazebr committed Dec 27, 2023
commit 2811fad6bb63eb0d72a4f44a3b77cca7d4aca260
1 change: 1 addition & 0 deletions pkg/contracts/src/RegistryFactory.sol
Original file line number Diff line number Diff line change
@@ -13,6 +13,7 @@ contract RegistryFactory {
{
RegistryGardens gardenRegistry = new RegistryGardens();
params._nonce = nonce++;
params.owner = msg.sender;
gardenRegistry.initialize(params);
return address(gardenRegistry);
}
17 changes: 15 additions & 2 deletions pkg/contracts/src/RegistryGardens.sol
Original file line number Diff line number Diff line change
@@ -71,6 +71,7 @@ contract RegistryGardens is ReentrancyGuard {
uint256 _protocolFee;
uint256 _nonce;
Metadata _metadata;
address owner;
}

//TODO: can change to uint32 with optimized storage order
@@ -99,13 +100,21 @@ contract RegistryGardens is ReentrancyGuard {
gardenToken = params._gardenToken;
minimumStakeAmount = params._minimumStakeAmount;
protocolFee = params._protocolFee;
gardenOwner = msg.sender;
// gardenOwner = msg.sender; //@todo: RegistryFactory is the onwer of that contract, that need be able to change the owner
gardenOwner = params.owner; //@todo: check if address(0) is a valid owner
registry = IRegistry(allo.getRegistry());
address[] memory initialmembers = new address[](0);
profileId = registry.createProfile(params._nonce, communityName, params._metadata, msg.sender, initialmembers);
}

function setCouncilMembers(address[] memory _members) public {}
//@todo: maybe we want use ROLES instead fixed address that give mroe flexibility
//@todo: also who should be allowed to set the council members? the DAO? the garden owner?
function setCouncilMembers(address[] memory _members) public onlyGardenOwner{
for (uint256 i = 0; i < _members.length; i++) {
councilMembers[_members[i]] = true;
}
emit CouncilMemberSet(_members);
}

function addStrategy(address _newStrategy) public onlyRegistryMember {
if (enabledStrategies[_newStrategy]) {
@@ -179,6 +188,10 @@ contract RegistryGardens is ReentrancyGuard {
return minimumStakeAmount;
}

function setBasisStakedAmount(uint256 _newAmount) external onlyCouncilMember {
minimumStakeAmount = _newAmount;
}

function updateProtocolFee(uint256 _newProtocolFee) public {
if (!isCouncilMember(msg.sender)) {
revert("Must be in council safe");