Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
46 changes: 38 additions & 8 deletions .github/workflows/foundry_runScript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,46 @@ jobs:
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Extract rpc url
id: url

- name: Extract chain id
id: chainid
run: |
CHAIN_ID=$(gh pr view ${{ github.event.pull_request.number }} --json body -q '.body' | grep -oP 'chainid:\s*\K[^\s]+' || echo "")
if [ -z "$CHAIN_ID" ]; then
echo "No chain id found in PR description. Please add 'chainid: <id>' to the PR description."
exit 1
fi
echo "chainid=$CHAIN_ID" >> $GITHUB_OUTPUT

- name: Extract operation
id: operation
run: |
OPERATION=$(gh pr view ${{ github.event.pull_request.number }} --json body -q '.body' | grep -oP 'operation:\s*\K[^\s]+' || echo "")
if [ -z "$OPERATION" ]; then
echo "No operation found in PR description. Please add 'operation: <operation>' to the PR description."
exit 1
fi
echo "operation=$OPERATION" >> $GITHUB_OUTPUT

- name: Extract previous version
id: previousversion
run: |
PREVIOUS_VERSION=$(gh pr view ${{ github.event.pull_request.number }} --json body -q '.body' | grep -oP 'previousversion:\s*\K[^\s]+' || echo "")
if [ -z "$PREVIOUS_VERSION" ]; then
echo "No previous version found in PR description. Please add 'previousversion: <version>' to the PR description."
exit 1
fi
echo "previousversion=$PREVIOUS_VERSION" >> $GITHUB_OUTPUT

- name: Extract new version
id: newversion
run: |
RPC_URL=$(gh pr view ${{ github.event.pull_request.number }} --json body -q '.body' | grep -oP 'rpc:\s*\K[^\s]+' || echo "")
if [ -z "$RPC_URL" ]; then
echo "No rpc url found in PR description. Please add 'rpc: <url>' to the PR description."
NEW_VERSION=$(gh pr view ${{ github.event.pull_request.number }} --json body -q '.body' | grep -oP 'newversion:\s*\K[^\s]+' || echo "")
if [ -z "$NEW_VERSION" ]; then
echo "No new version found in PR description. Please add 'newversion: <version>' to the PR description."
exit 1
fi
echo "url=$RPC_URL" >> $GITHUB_OUTPUT
echo "newversion=$NEW_VERSION" >> $GITHUB_OUTPUT

- name: Run Forge build
run: |
Expand All @@ -70,4 +100,4 @@ jobs:
- name: Run safe propose script
if: ${{ steps.check_pr.outputs.should_run }} == 'true'
run: |
npx hardhat safe-propose --chainid 1315 --operation schedule --previousversion 1.5.0 --newversion 1.5.1 --safeproposeraddress ${{ env.SAFE_MULTISIG_PROPOSER_ADDRESS }} --safeproposerprivatekey ${{ env.SAFE_MULTISIG_PROPOSER_PRIVATE_KEY }} --safemultisigaddressmainnet ${{ env.SAFE_MULTISIG_MAINNET_ADDRESS }} --safemultisigaddressaeneid ${{ env.SAFE_MULTISIG_AENEID_ADDRESS }}
npx hardhat safe-propose --chainid ${{ steps.chainid.outputs.chainid }} --operation ${{ steps.operation.outputs.operation }} --previousversion ${{ steps.previousversion.outputs.previousversion }} --newversion ${{ steps.newversion.outputs.newversion }} --safeproposeraddress ${{ env.SAFE_MULTISIG_PROPOSER_ADDRESS }} --safeproposerprivatekey ${{ env.SAFE_MULTISIG_PROPOSER_PRIVATE_KEY }} --safemultisigaddressmainnet ${{ env.SAFE_MULTISIG_MAINNET_ADDRESS }} --safemultisigaddressaeneid ${{ env.SAFE_MULTISIG_AENEID_ADDRESS }}
1 change: 0 additions & 1 deletion script/hardhat/utils/safePropose.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ task("safe-propose", "Propose a Safe transaction")
const SAFE_PROPOSER_PRIVATE_KEY = taskArgs.safeproposerprivatekey
const RPC_URL = chainId === MAINNET_CHAIN_ID ? 'https://mainnet.storyrpc.io' : 'https://aeneid.storyrpc.io'
const SAFE_ADDRESS = chainId === MAINNET_CHAIN_ID ? taskArgs.safemultisigaddressmainnet : taskArgs.safemultisigaddressaeneid

const TX_SERVICE_URL = chainId === MAINNET_CHAIN_ID ? 'https://transaction.safe.story.foundation/api' : 'https://transaction-testnet.safe.story.foundation/api'

const apiKit = new SafeApiKit({
Expand Down