-
yarn add @gnosis.pm/safe-contracts
-
Optional for testing
yarn add eth-lightwallet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
contract Enum { | |
enum Operation { | |
Call, | |
DelegateCall | |
} | |
} | |
contract MasterCopy { | |
event ChangedMasterCopy(address masterCopy); |
Create Safe app with typescript support using yarn as a package manager.
npx create-react-app sapps_getting_started --typescript
cd sapps_getting_started
yarn add https://github.com/gnosis/safe-apps-sdk
- add
description
andiconPath
tomanifest.json
(see https://github.com/gnosis/safe-apps-sdk) - Setup cors as mentioned in the readme of https://github.com/gnosis/safe-react-apps
- Call
initSdk
with[/.*localhost.*/]
- this allows to use your local safe-react instance - Add listeners (see https://github.com/gnosis/safe-apps-sdk)
- Install ipfs (https://gist.github.com/MiguelBel/b3b5f711aa8d9362afa5f16e4e972461)
- Add
.env.development
with
HTTPS=true
PORT=3002
- Add http-proxy-middleware
yarn add http-proxy-middleware
- Add
setupProxy.js
in./src
with
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import EIP712Domain from "eth-typed-data"; | |
import BigNumber from "bignumber.js"; | |
import * as ethUtil from 'ethereumjs-util'; | |
import { ethers } from "ethers"; | |
import axios from "axios"; | |
/* | |
* Safe relay service example | |
* * * * * * * * * * * * * * * * * * * */ |
This guide outlines how to create a template that can be used with https://rimeissner.dev/transaction-templates/
A template is a json file that has a root object with the properties name
, inputs
, txs
.
The inputs
are used together with the txs
to generated the final transactions. Also a simple interface with input fiels is generated for the specified inputs.