Skip to content

Commit

Permalink
add metaId to ProposalMeta event
Browse files Browse the repository at this point in the history
  • Loading branch information
jac18281828 committed Oct 31, 2022
1 parent f69401c commit 46388b0
Show file tree
Hide file tree
Showing 6 changed files with 175 additions and 5 deletions.
20 changes: 18 additions & 2 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,19 @@
"isDefault": false
}
},
{
"label": "deployconstant",
"type": "shell",
"command": "forge create --contracts contracts/Constant.sol --rpc-url ${DEVNET_RPC_URL} --private-key ${ETH_DEV_PRIVATE} --etherscan-api-key ${ETHERSCAN_API_KEY} --verify Constant",
"options": {
"cwd": "${workspaceFolder}"
},
"dependsOn": "production",
"group": {
"kind": "test",
"isDefault": false
}
},
{
"label": "deployfactory",
"type": "shell",
Expand All @@ -106,9 +119,12 @@
{
"label": "deploybuilder",
"type": "shell",
"command": "forge create --contracts contracts/GovernanceBuilder.sol --rpc-url ${DEVNET_RPC_URL} --private-key ${ETH_DEV_PRIVATE} --etherscan-api-key ${ETHERSCAN_API_KEY} --verify GovernanceBuilder",
"command": "forge create --libraries contracts/Constant.sol:Constant:${CONSTANT_LIB_ADDRESS} --contracts contracts/GovernanceBuilder.sol --rpc-url ${DEVNET_RPC_URL} --private-key ${ETH_DEV_PRIVATE} --etherscan-api-key ${ETHERSCAN_API_KEY} --verify GovernanceBuilder",
"options": {
"cwd": "${workspaceFolder}"
"cwd": "${workspaceFolder}",
"env": {
"CONSTANT_LIB_ADDRESS": "0xaDFDc9ADe7B4199179E0eeF0ce8e67E12a92A50F"
}
},
"dependsOn": "production",
"group": {
Expand Down
114 changes: 114 additions & 0 deletions abi/Governance.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,31 @@
"name": "ProposalCreated",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint256",
"name": "proposalId",
"type": "uint256"
},
{
"indexed": false,
"internalType": "string",
"name": "description",
"type": "string"
},
{
"indexed": false,
"internalType": "string",
"name": "url",
"type": "string"
}
],
"name": "ProposalDescription",
"type": "event"
},
{
"anonymous": false,
"inputs": [
Expand All @@ -61,6 +86,43 @@
"name": "ProposalExecuted",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint256",
"name": "proposalId",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "metaId",
"type": "uint256"
},
{
"indexed": false,
"internalType": "bytes32",
"name": "name",
"type": "bytes32"
},
{
"indexed": false,
"internalType": "string",
"name": "value",
"type": "string"
},
{
"indexed": false,
"internalType": "address",
"name": "sender",
"type": "address"
}
],
"name": "ProposalMeta",
"type": "event"
},
{
"anonymous": false,
"inputs": [
Expand Down Expand Up @@ -278,6 +340,35 @@
"name": "RebatePaid",
"type": "event"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_proposalId",
"type": "uint256"
},
{
"internalType": "bytes32",
"name": "_name",
"type": "bytes32"
},
{
"internalType": "string",
"name": "_value",
"type": "string"
}
],
"name": "addMeta",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
Expand Down Expand Up @@ -394,6 +485,29 @@
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_proposalId",
"type": "uint256"
},
{
"internalType": "string",
"name": "_description",
"type": "string"
},
{
"internalType": "string",
"name": "_url",
"type": "string"
}
],
"name": "describe",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "description",
Expand Down
39 changes: 39 additions & 0 deletions abi/Storage.json
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,19 @@
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "community",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
Expand All @@ -651,6 +664,19 @@
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "description",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
Expand Down Expand Up @@ -1382,6 +1408,19 @@
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "url",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "version",
Expand Down
2 changes: 1 addition & 1 deletion contracts/CollectiveGovernance.sol
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ contract CollectiveGovernance is Governance, VoteStrategy, ERC165 {
string memory _value
) external returns (uint256) {
uint256 metaId = _storage.addMeta(_proposalId, _name, _value, msg.sender);
emit ProposalMeta(_proposalId, _name, _value, msg.sender);
emit ProposalMeta(_proposalId, metaId, _name, _value, msg.sender);
return metaId;
}

Expand Down
3 changes: 2 additions & 1 deletion contracts/Constant.sol
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@
pragma solidity ^0.8.15;

/**
@notice extract global manifest constants
* @notice extract global manifest constants
* @dev hash b28717930d5c821c80736e02d025efa7f9cb615e deployed to 0xaDFDc9ADe7B4199179E0eeF0ce8e67E12a92A50F
*/
library Constant {
uint256 public constant UINT_MAX = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF;
Expand Down
2 changes: 1 addition & 1 deletion contracts/Governance.sol
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ interface Governance is IERC165 {
);

/// @notice ProposalMeta attached
event ProposalMeta(uint256 proposalId, bytes32 name, string value, address sender);
event ProposalMeta(uint256 proposalId, uint256 metaId, bytes32 name, string value, address sender);
/// @notice The proposal description
event ProposalDescription(uint256 proposalId, string description, string url);
/// @notice The proposal is now open for voting
Expand Down

0 comments on commit 46388b0

Please sign in to comment.