diff --git a/package.json b/package.json index 74f56e0..baa04a3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@bgd-labs/aave-tenderly-cli", - "version": "0.0.7", + "version": "0.0.8", "description": "", "main": "main.ts", "private": false, @@ -10,7 +10,7 @@ "scripts": { "start": "npm run build && node dist/index.js", "build": "ncc build ./main.ts -o dist --minify", - "publish:local": "npm run build && npm pack && npm i -g bgd-labs-aave-tenderly-cli-0.0.7.tgz && rm bgd-labs-aave-tenderly-cli-0.0.7.tgz" + "publish:local": "npm run build && npm pack && npm i -g bgd-labs-aave-tenderly-cli-0.0.8.tgz && rm bgd-labs-aave-tenderly-cli-0.0.8.tgz" }, "repository": { "type": "git", diff --git a/src/l2Gov.ts b/src/l2Gov.ts index 87da9d2..444df38 100644 --- a/src/l2Gov.ts +++ b/src/l2Gov.ts @@ -62,6 +62,13 @@ export async function executeL2Payload({ const payload = new Contract( payloadAddress, [ + { + inputs: [], + name: "owner", + outputs: [{ internalType: "address", name: "", type: "address" }], + stateMutability: "view", + type: "function", + }, { inputs: [], name: "execute", @@ -73,7 +80,16 @@ export async function executeL2Payload({ provider.getSigner() ); - await payload.execute(); + // sometimes payloads use ownable and onlyOwner modifier on `execute` + // therefore we check if we can fetch owner and set the owner as signer + try { + const owner = await payload.owner(); + const payloadWithOwner = payload.connect(provider.getSigner(owner)); + await payloadWithOwner.execute(); + } catch (e) { + await payload.execute(); + } + console.log("executed payload"); } catch (e: any) { console.log(e.message); diff --git a/yarn-error.log b/yarn-error.log deleted file mode 100644 index 87dee74..0000000 --- a/yarn-error.log +++ /dev/null @@ -1,69 +0,0 @@ -Arguments: - /home/sakulstra/.nvm/versions/node/v16.13.0/bin/node /home/sakulstra/.nvm/versions/node/v16.13.0/bin/yarn add @bgd/aave-address-book - -PATH: - /home/sakulstra/.meteor:/home/sakulstra/.nvm/versions/node/v16.13.0/bin:/home/sakulstra/.local/bin:/usr/local/bin:/usr/bin:/var/lib/snapd/snap/bin:/usr/local/sbin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/home/sakulstra/.foundry/bin - -Yarn version: - 1.22.18 - -Node version: - 16.13.0 - -Platform: - linux x64 - -Trace: - Error: https://registry.yarnpkg.com/@bgd%2faave-address-book: Not found - at Request.params.callback [as _callback] (/home/sakulstra/.nvm/versions/node/v16.13.0/lib/node_modules/yarn/lib/cli.js:66138:18) - at Request.self.callback (/home/sakulstra/.nvm/versions/node/v16.13.0/lib/node_modules/yarn/lib/cli.js:140883:22) - at Request.emit (node:events:390:28) - at Request. (/home/sakulstra/.nvm/versions/node/v16.13.0/lib/node_modules/yarn/lib/cli.js:141855:10) - at Request.emit (node:events:390:28) - at IncomingMessage. (/home/sakulstra/.nvm/versions/node/v16.13.0/lib/node_modules/yarn/lib/cli.js:141777:12) - at Object.onceWrapper (node:events:509:28) - at IncomingMessage.emit (node:events:402:35) - at endReadableNT (node:internal/streams/readable:1343:12) - at processTicksAndRejections (node:internal/process/task_queues:83:21) - -npm manifest: - { - "name": "@bgd-labs/aave-tenderly-cli", - "version": "0.0.2", - "description": "", - "main": "main.ts", - "private": false, - "bin": { - "aave-tenderly-cli": "dist/index.js" - }, - "scripts": { - "start": "npm run build && node dist/index.js", - "build": "ncc build ./main.ts -o dist --minify", - "publish:local": "npm run build && npm pack && npm i -g bgd-labs-aave-tenderly-cli-0.0.2.tgz && rm bgd-labs-aave-tenderly-cli-0.0.2.tgz" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/bgd-labs/aave-tenderly-cli.git" - }, - "author": "", - "license": "MIT", - "bugs": { - "url": "https://github.com/bgd-labs/aave-tenderly-cli/issues" - }, - "homepage": "https://github.com/bgd-labs/aave-tenderly-cli#readme", - "devDependencies": { - "@types/node": "^18.7.13", - "@vercel/ncc": "^0.34.0", - "typescript": "^4.8.2", - "axios": "^0.27.2", - "commander": "^9.4.0", - "dotenv": "^16.0.1", - "ethers": "^5.6.9" - } - } - -yarn manifest: - No manifest - -Lockfile: - No lockfile