Skip to content

Commit

Permalink
proposal: emission manager final tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
Oighty committed Nov 19, 2024
1 parent 936e521 commit e242564
Show file tree
Hide file tree
Showing 5 changed files with 140 additions and 11 deletions.
17 changes: 6 additions & 11 deletions src/proposals/EmissionManagerProposal.sol
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,8 @@ contract EmissionManagerProposal is GovernorBravoProposal {
function description() public pure override returns (string memory) {
return
string.concat(
"# Initialize Emissions Manager Policy\n",
"\n",
"## Summary\n",
"Install the Emissions Manager into the protocol, providing it with minter privileges to allow it to emit new supply.\n",
"\n",
"# OIP-171 - Activation of Emissions Manager Policy\n\n",
"## Summary\n\nThe primary supply emission structure of Olympus has the protocol offer new tokens when the market for OHM is at a premium. This vote will grant permission to activate and properly role the new emissions contract - 0x50f441a3387625bDA8B8081cE3fd6C04CC48C0A2\n\n",
"## Justification\n",
"The Emissions Manager allows the protocol to grow treasury, backing, and supply upon an increase in demand for OHM sufficient to push higher premiums.\n",
"\n",
Expand All @@ -63,8 +60,7 @@ contract EmissionManagerProposal is GovernorBravoProposal {
"\n",
"- [Read the forum proposal](https://forum.olympusdao.finance/d/4656-install-emissions-manager) for more context.\n",
"- The EmissionManager policy has been audited. [Read the audit report](https://storage.googleapis.com/olympusdao-landing-page-reports/audits/2024_11_EmissionManager_ReserveMigrator.pdf)\n",
"- The code changes can be found in pull request [#18](https://github.com/OlympusDAO/olympus-v3/pull/18)\n",
"- The proposal can be found in pull request [#21](https://github.com/OlympusDAO/olympus-v3/pull/21)\n",
"- The code changes and proposal can be found in pull request [#18](https://github.com/OlympusDAO/olympus-v3/pull/18)\n",
"\n",
"## Roles to Assign\n",
"\n",
Expand Down Expand Up @@ -96,8 +92,8 @@ contract EmissionManagerProposal is GovernorBravoProposal {

// Load variables
address timelock = addresses.getAddress("olympus-timelock");
address daoMS = addresses.getAddress("olympus-dao-ms");
address emissionManager = addresses.getAddress("olympus-policy-emissionmanager");
address daoMS = addresses.getAddress("olympus-multisig-dao");
// address emissionManager = addresses.getAddress("olympus-policy-emissionmanager");

// STEP 1: Assign roles
// 1a. Grant "emissions_admin" to the Timelock
Expand Down Expand Up @@ -151,9 +147,8 @@ contract EmissionManagerProposal is GovernorBravoProposal {
function _validate(Addresses addresses, address) internal view override {
// Load the contract addresses
ROLESv1 roles = ROLESv1(addresses.getAddress("olympus-module-roles"));
address emissionManager = addresses.getAddress("olympus-policy-emissionmanager");
address timelock = addresses.getAddress("olympus-timelock");
address daoMS = addresses.getAddress("olympus-dao-ms");
address daoMS = addresses.getAddress("olympus-multisig-dao");

// Validate the Timelock has the "emissions_admin" role
require(
Expand Down
61 changes: 61 additions & 0 deletions src/proposals/ProposalScript.sol
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,67 @@ abstract contract ProposalScript is ScriptSuite {
console2.log("Proposal ID:", proposalId);
}

function printProposalInputs() public {
// set debug mode to true and run it to build the actions list
proposal.setDebug(true);

// run the proposal to build it
proposal.run(addresses, address(0));

(address[] memory targets, uint256[] memory values, bytes[] memory calldatas) = proposal.getProposalActions();
uint256 len = targets.length;
// print the targets
console2.log("Targets:");
string memory t_str = "[";
for (uint256 i = 0; i < len; i++) {
if (i == len - 1) {
t_str = string.concat(t_str, vm.toString(targets[i]), "]");
} else {
t_str = string.concat(t_str, vm.toString(targets[i]), ", ");
}
}
console2.log(t_str);

// print the values
console2.log("Values:");
string memory v_str = "[";
for (uint256 i = 0; i < len; i++) {
if (i == len - 1) {
v_str = string.concat(v_str, vm.toString(values[i]), "]");
} else {
v_str = string.concat(v_str, vm.toString(values[i]), ", ");
}
}
console2.log(v_str);

// print the calldatas
console2.log("Calldatas:");
string memory c_str = "[";
for (uint256 i = 0; i < len; i++) {
if (i == len - 1) {
c_str = string.concat(c_str, vm.toString(calldatas[i]), "]");
} else {
c_str = string.concat(c_str, vm.toString(calldatas[i]), ", ");
}
}
console2.log(c_str);

// print the signatures list of empty strings
console2.log("Signatures:");
string memory s_str = "[";
for (uint256 i = 0; i < len; i++) {
if (i == len - 1) {
s_str = string.concat(s_str, '""', "]");
} else {
s_str = string.concat(s_str, '""', ", ");
}
}

// print the description
console2.log("Description:");
console2.log(proposal.description());
}

function executeOnTestnet() public {
console2.log("Building proposal...");
// set debug mode to true and run it to build the actions list
Expand Down
Empty file modified src/scripts/proposals/executeOnTestnet.sh
100644 → 100755
Empty file.
73 changes: 73 additions & 0 deletions src/scripts/proposals/printInputs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
#!/bin/bash

# This script prints the inputs for a proposal to the governor.
#
# Usage: src/scripts/proposals/printInputs.sh --file <proposal-path> --contract <contract-name> --account <forge account> --fork <true|false> --env <env-file>
#
# Environment variables:
# RPC_URL

# Exit if any error occurs
set -e

# Iterate through named arguments
# Source: https://unix.stackexchange.com/a/388038
while [ $# -gt 0 ]; do
if [[ $1 == *"--"* ]]; then
v="${1/--/}"
declare $v="$2"
fi

shift
done

# Get the name of the .env file or use the default
ENV_FILE=${env:-".env"}
echo "Sourcing environment variables from $ENV_FILE"

# Load environment file
set -a # Automatically export all variables
source $ENV_FILE
set +a # Disable automatic export

# Apply defaults to command-line arguments
FORK=${fork:-false}

# Check if the proposal file was specified
if [ -z "$file" ]; then
echo "Error: Proposal file was not specified"
exit 1
fi

# Check if the proposal file exists
if [ ! -f "$file" ]; then
echo "Error: Proposal file does not exist. Provide the correct relative path after the --file flag."
exit 1
fi

# Check if the contract name was specified
if [ -z "$contract" ]; then
echo "Error: Contract name was not specified"
exit 1
fi

# Check if the RPC_URL was specified
if [ -z "$RPC_URL" ]; then
echo "Error: RPC_URL was not specified"
exit 1
fi

echo "Using proposal contract: $file:$contract"
echo "Using RPC at URL: $RPC_URL"

# Set the fork flag
FORK_FLAG=""
if [ "$FORK" = "true" ]; then
FORK_FLAG="--legacy"
echo "Fork: enabled"
else
echo "Fork: disabled"
fi

# Run the forge script
forge script $file:$contract --sig "printProposalInputs()" -vvv --rpc-url $RPC_URL $FORK_FLAG
Empty file modified src/scripts/proposals/submitProposal.sh
100644 → 100755
Empty file.

0 comments on commit e242564

Please sign in to comment.