mirror of
https://github.com/status-im/safe-react.git
synced 2025-01-11 18:44:07 +00:00
decoding params from settings txs wip
This commit is contained in:
parent
9dfdd4f4b1
commit
a2c2793788
@ -50,12 +50,12 @@
|
||||
"react-dom": "^16.8.6",
|
||||
"react-final-form": "6.3.0",
|
||||
"react-final-form-listeners": "^1.0.2",
|
||||
"react-hot-loader": "4.12.5",
|
||||
"react-hot-loader": "4.12.6",
|
||||
"react-infinite-scroll-component": "^4.5.2",
|
||||
"react-redux": "7.1.0",
|
||||
"react-router-dom": "^4.3.1",
|
||||
"recompose": "^0.30.0",
|
||||
"redux": "4.0.3",
|
||||
"redux": "4.0.4",
|
||||
"redux-actions": "^2.3.0",
|
||||
"redux-thunk": "^2.2.0",
|
||||
"reselect": "^4.0.0",
|
||||
|
63
src/logic/contracts/methodIds.js
Normal file
63
src/logic/contracts/methodIds.js
Normal file
@ -0,0 +1,63 @@
|
||||
// @flow
|
||||
import { getWeb3 } from '~/logic/wallets/getWeb3'
|
||||
|
||||
// SAFE METHODS TO ITS ID
|
||||
// https://github.com/gnosis/safe-contracts/blob/development/test/safeMethodNaming.js
|
||||
// [
|
||||
// { name: "addOwnerWithThreshold", id: "0x0d582f13" },
|
||||
// { name: "DOMAIN_SEPARATOR_TYPEHASH", id: "0x1db61b54" },
|
||||
// { name: "isOwner", id: "0x2f54bf6e" },
|
||||
// { name: "execTransactionFromModule", id: "0x468721a7" },
|
||||
// { name: "signedMessages", id: "0x5ae6bd37" },
|
||||
// { name: "enableModule", id: "0x610b5925" },
|
||||
// { name: "changeThreshold", id: "0x694e80c3" },
|
||||
// { name: "approvedHashes", id: "0x7d832974" },
|
||||
// { name: "changeMasterCopy", id: "0x7de7edef" },
|
||||
// { name: "SENTINEL_MODULES", id: "0x85e332cd" },
|
||||
// { name: "SENTINEL_OWNERS", id: "0x8cff6355" },
|
||||
// { name: "getOwners", id: "0xa0e67e2b" },
|
||||
// { name: "NAME", id: "0xa3f4df7e" },
|
||||
// { name: "nonce", id: "0xaffed0e0" },
|
||||
// { name: "getModules", id: "0xb2494df3" },
|
||||
// { name: "SAFE_MSG_TYPEHASH", id: "0xc0856ffc" },
|
||||
// { name: "SAFE_TX_TYPEHASH", id: "0xccafc387" },
|
||||
// { name: "disableModule", id: "0xe009cfde" },
|
||||
// { name: "swapOwner", id: "0xe318b52b" },
|
||||
// { name: "getThreshold", id: "0xe75235b8" },
|
||||
// { name: "domainSeparator", id: "0xf698da25" },
|
||||
// { name: "removeOwner", id: "0xf8dc5dd9" },
|
||||
// { name: "VERSION", id: "0xffa1ad74" },
|
||||
// { name: "setup", id: "0xa97ab18a" },
|
||||
// { name: "execTransaction", id: "0x6a761202" },
|
||||
// { name: "requiredTxGas", id: "0xc4ca3a9c" },
|
||||
// { name: "approveHash", id: "0xd4d9bdcd" },
|
||||
// { name: "signMessage", id: "0x85a5affe" },
|
||||
// { name: "isValidSignature", id: "0x20c13b0b" },
|
||||
// { name: "getMessageHash", id: "0x0a1028c4" },
|
||||
// { name: "encodeTransactionData", id: "0xe86637db" },
|
||||
// { name: "getTransactionHash", id: "0xd8d11f78" }
|
||||
// ]
|
||||
|
||||
export const decodeParamsFromSafeMethod = async (data) => {
|
||||
const web3 = await getWeb3()
|
||||
|
||||
switch (data.slice(0, 10)) {
|
||||
// swapOwner
|
||||
case '0xe318b52b':
|
||||
return
|
||||
|
||||
// addOwnerWithThreshold
|
||||
case '0x0d582f13':
|
||||
return
|
||||
|
||||
// removeOwner
|
||||
case '0xf8dc5dd9':
|
||||
return
|
||||
|
||||
case '0x694e80c3':
|
||||
return
|
||||
|
||||
default:
|
||||
return {}
|
||||
}
|
||||
}
|
16
yarn.lock
16
yarn.lock
@ -13538,10 +13538,10 @@ react-helmet-async@^1.0.2:
|
||||
react-fast-compare "2.0.4"
|
||||
shallowequal "1.1.0"
|
||||
|
||||
react-hot-loader@4.12.5:
|
||||
version "4.12.5"
|
||||
resolved "https://registry.yarnpkg.com/react-hot-loader/-/react-hot-loader-4.12.5.tgz#ebe5b6a68190b14fce42151fff03d1ad43634e9b"
|
||||
integrity sha512-RH7mi2hSp+74pM/GCwFoQ+nHY6JnFKrzBNbSWnOfT9LJMMnCWf/Eg5CoaeJHMpvqF+x6hdT//T2GoSpqImEzfg==
|
||||
react-hot-loader@4.12.6:
|
||||
version "4.12.6"
|
||||
resolved "https://registry.yarnpkg.com/react-hot-loader/-/react-hot-loader-4.12.6.tgz#bd7a41501b02576638031482474a72bac453587d"
|
||||
integrity sha512-tRXWgF5MhQSEXX3EHIplCOWCzSg+ye7ddHeQLt7Z+CaZMeEfeCL2/uSGITIzWXOQYhefnLX8IZtr2cff4xIrww==
|
||||
dependencies:
|
||||
fast-levenshtein "^2.0.6"
|
||||
global "^4.3.0"
|
||||
@ -13966,10 +13966,10 @@ redux-thunk@^2.2.0:
|
||||
resolved "https://registry.yarnpkg.com/redux-thunk/-/redux-thunk-2.3.0.tgz#51c2c19a185ed5187aaa9a2d08b666d0d6467622"
|
||||
integrity sha512-km6dclyFnmcvxhAcrQV2AkZmPQjzPDjgVlQtR0EQjxZPyJ0BnMf3in1ryuR8A2qU0HldVRfxYXbFSKlI3N7Slw==
|
||||
|
||||
redux@4.0.3:
|
||||
version "4.0.3"
|
||||
resolved "https://registry.yarnpkg.com/redux/-/redux-4.0.3.tgz#0ca18be085e6cf6ed50e445a125f85e8b26b266b"
|
||||
integrity sha512-v/Iaw67Pe+na+cZvcKvPxAKT1ww5kM+M09fmaCndCQC4Lo434AYb5975HJgJlp0D7dJxfYaLxMD4VwfpLOZ1Rw==
|
||||
redux@4.0.4:
|
||||
version "4.0.4"
|
||||
resolved "https://registry.yarnpkg.com/redux/-/redux-4.0.4.tgz#4ee1aeb164b63d6a1bcc57ae4aa0b6e6fa7a3796"
|
||||
integrity sha512-vKv4WdiJxOWKxK0yRoaK3Y4pxxB0ilzVx6dszU2W8wLxlb2yikRph4iV/ymtdJ6ZxpBLFbyrxklnT5yBbQSl3Q==
|
||||
dependencies:
|
||||
loose-envify "^1.4.0"
|
||||
symbol-observable "^1.2.0"
|
||||
|
Loading…
x
Reference in New Issue
Block a user