Skip to content
This repository was archived by the owner on Aug 20, 2025. It is now read-only.
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
2 changes: 1 addition & 1 deletion examples/action-proposal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ async function main() {
functionInterface: { name: 'setNumber', inputs: [{ name: '_value', type: 'uint256' }] },
functionInputs: ['42'],
via: '0xF608FA64c4fF8aDdbEd106E69f3459effb4bC3D1',
viaType: 'Gnosis Safe',
viaType: 'Safe',
});

console.log(proposal.url);
Expand Down
2 changes: 1 addition & 1 deletion examples/batch-proposal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ async function main() {
description: 'Mint, transfer and modify access control',
type: 'batch',
via: safeAddress,
viaType: 'Gnosis Safe',
viaType: 'Safe',
metadata: {}, // Required field but empty
steps,
});
Expand Down
2 changes: 1 addition & 1 deletion examples/pause-proposal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ async function main() {
{
title: 'Pause contract',
via: '0xF608FA64c4fF8aDdbEd106E69f3459effb4bC3D1',
viaType: 'Gnosis Safe',
viaType: 'Safe',
},
{ network, address },
);
Expand Down
2 changes: 1 addition & 1 deletion examples/unpause-proposal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ async function main() {
{
title: 'Unpause contract',
via: '0xF608FA64c4fF8aDdbEd106E69f3459effb4bC3D1',
viaType: 'Gnosis Safe',
viaType: 'Safe',
},
{ network, address },
);
Expand Down
14 changes: 7 additions & 7 deletions packages/admin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ await client.createProposal({
functionInterface: { name: 'setFee', inputs: [{ type: 'uint256', name: 'fee' }] }, // Function ABI
functionInputs: ['10'], // Arguments to the function
via: '0x22d491Bde2303f2f43325b2108D26f1eAbA1e32b', // Address to execute proposal
viaType: 'Gnosis Safe', // 'Gnosis Safe', 'Gnosis Multisig', or 'EOA'
viaType: 'Safe', // 'Gnosis Multisig', 'Safe' or 'EOA'
});
```

Expand Down Expand Up @@ -81,13 +81,13 @@ const proposalWithSimulation = await client.createProposal({

#### Issuing DELEGATECALLs

When invoking a function via a Gnosis Safe, it's possible to call it via a `DELEGATECALL` instruction instead of a regular call. This has the effect of executing the code in the called contract _in the context of the multisig_, meaning any operations that affect storage will affect the multisig, and any calls to additional contracts will be executed as if the `msg.sender` were the multisig. To do this, add a `metadata` parameter with the value `{ operationType: 'delegateCall' }` to your `createProposal` call:
When invoking a function via a Safe Wallet, it's possible to call it via a `DELEGATECALL` instruction instead of a regular call. This has the effect of executing the code in the called contract _in the context of the multisig_, meaning any operations that affect storage will affect the multisig, and any calls to additional contracts will be executed as if the `msg.sender` were the multisig. To do this, add a `metadata` parameter with the value `{ operationType: 'delegateCall' }` to your `createProposal` call:

```js
await client.createProposal({
// ... Include all parameters from the example above
via: '0x22d491Bde2303f2f43325b2108D26f1eAbA1e32b', // Multisig address
viaType: 'Gnosis Safe', // Must be Gnosis Safe to handle delegate calls
viaType: 'Safe', // Must be Safe to handle delegate calls
metadata: { operationType: 'delegateCall' }, // Issue a delegatecall instead of a regular call
});
```
Expand Down Expand Up @@ -122,7 +122,7 @@ await client.proposeUpgrade({ newImplementation, newImplementationAbi, proxyAdmi
```js
const newImplementation = '0x3E5e9111Ae8eB78Fe1CC3bb8915d5D461F3Ef9A9';
const via = '0xF608FA64c4fF8aDdbEd106E69f3459effb4bC3D1';
const viaType = 'Gnosis Safe'; // or 'Gnosis Multisig', or 'EOA'
const viaType = 'Safe'; // 'Gnosis Multisig', 'Safe' or 'EOA'
const contract = { network: 'goerli', address: '0x28a8746e75304c0780E011BEd21C72cD78cd535E' };
const newImplementationAbi = '[...]';
await client.proposeUpgrade({ newImplementation, newImplementationAbi, via, viaType }, contract);
Expand All @@ -136,10 +136,10 @@ To create `pause` and `unpause` action proposals, you need to provide the contra
const contract = { network: 'goerli', address: '0x28a8746e75304c0780E011BEd21C72cD78cd535E' };

// Create a pause proposal
await client.proposePause({ via: '0x22d491Bde2303f2f43325b2108D26f1eAbA1e32b', viaType: 'Gnosis Safe' }, contract);
await client.proposePause({ via: '0x22d491Bde2303f2f43325b2108D26f1eAbA1e32b', viaType: 'Safe' }, contract);

// Create an unpause proposal
await client.proposeUnpause({ via: '0x22d491Bde2303f2f43325b2108D26f1eAbA1e32b', viaType: 'Gnosis Safe' }, contract);
await client.proposeUnpause({ via: '0x22d491Bde2303f2f43325b2108D26f1eAbA1e32b', viaType: 'Safe' }, contract);
```

Note that for `pause` and `unpause` proposals to work, your contract ABI must include corresponding `pause()` and `unpause()` functions.
Expand Down Expand Up @@ -208,7 +208,7 @@ await client.createProposal({
description: 'Mint, transfer and modify access control',
type: 'batch',
via: safeAddress,
viaType: 'Gnosis Safe',
viaType: 'Safe',
metadata: {}, // Required field but empty
steps,
});
Expand Down
2 changes: 1 addition & 1 deletion packages/admin/src/models/proposal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export interface ExternalApiCreateProposalRequest {
type: ProposalType;
metadata?: ProposalMetadata;
via?: Address;
viaType?: 'EOA' | 'Gnosis Safe' | 'Gnosis Multisig' | 'Relayer';
viaType?: 'EOA' | 'Safe' | 'Gnosis Multisig' | 'Relayer';
functionInterface?: ProposalTargetFunction;
functionInputs?: ProposalFunctionInputs;
steps?: ProposalStep[];
Expand Down
2 changes: 1 addition & 1 deletion packages/deploy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ There are a number of optional fields, these include:
- `proxyAdminAddress` - The Proxy Admin address in case you are upgrading with a transparent proxy.
- `newImplementationABI` - The ABI of the new implementation address. This will be required if the implementation contract does not exist in the OpenZeppelin Platform.
- `approvalProcessId` - The approval process ID in case you wish to override the default global approval process.
- `senderAddress` - The address you wish to create the Gnosis proposal with. When creating an upgrade proposal, we provide you with an external link to the Gnosis Safe UI. This will lead you to a proposal ready to be signed. This proposal will contain information about what upgrade to execute, as well as who initiated the proposal. The `senderAddress` property lets you customise define which address this is.
- `senderAddress` - The address you wish to create the Safe proposal with. When creating an upgrade proposal, we provide you with an external link to the Safe UI. This will lead you to a proposal ready to be signed. This proposal will contain information about what upgrade to execute, as well as who initiated the proposal. The `senderAddress` property lets you customise define which address this is.

Below is an example of a contract upgrade request which responds with a `UpgradeContractResponse`

Expand Down
2 changes: 1 addition & 1 deletion packages/deploy/src/models/approval-process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export interface ApprovalProcessResponse {
| 'EOA'
| 'Contract'
| 'Multisig'
| 'Gnosis Safe'
| 'Safe'
| 'Gnosis Multisig'
| 'Relayer'
| 'Unknown'
Expand Down