safe-wrapped-contract
v1.0.6
Published
Create safe-wrapped contracts to make contract calls with Gnosis safes
Downloads
13
Readme
Package to interact with smart contracts with Gnosis Safe
For those wishing to use Gnosis safes headlessly to propose new txs or deploy contracts
Usage
- Install the package
yarn add -D safe-wrapped-contract
- Import in the script file
import { getSafeWrappedContract } from "safe-wrapped-contract";
- Call the
getSafeWrappedContract
function and it will return a new contract. Simply interact with the contract and the new tx(s) will be shown on the Safe UI.
Caveat
The tx(s) submitted are required to be successful, or a "GS013" error will be shown. See Safe contracts
Test
The following test procedure simulates how a project uses this package
- run
yarn link
in root cd test/project && yarn
- Run
yarn link safe-wrapped-contract
to link to local package, if getting cannot find module, make sure to build first in root yarn test --network <NETWORK>
- see the results on the Safe UI
- (Optional) Test proxy contracts using delegate calls
yarn hardhat run scripts/testSafeWrappedDelegateCall.ts --network <NETWORK>
- if package's code is changed, run
yarn build
in root to rebuild the package - after testing, run
yarn unlink safe-wrapped-contract
in test/project, thenyarn unlink
in root.
Publish
Run yarn publish
Info
Goerli safe service url: https://safe-transaction-goerli.safe.global