diff --git a/.env.example b/.env.example index 33d8a508..266bbc27 100644 --- a/.env.example +++ b/.env.example @@ -26,3 +26,7 @@ REACT_APP_APP_VERSION=$npm_package_version # For Apps REACT_APP_GNOSIS_APPS_URL=https://safe-apps.staging.gnosisdev.com + +# Contracts Addresses +REACT_APP_SPENDING_LIMIT_MODULE_ADDRESS=0x9e9Bf12b5a66c0f0A7435835e0365477E121B110 + diff --git a/package.json b/package.json index 65d19bf0..39ca85ca 100644 --- a/package.json +++ b/package.json @@ -26,8 +26,9 @@ "electron-build": "electron-builder --mac --windows --linux", "electron-dev": "concurrently \"BROWSER=none yarn start\" \"wait-on http://localhost:3000 && electron .\"", "format:staged": "lint-staged", - "generate-types": "yarn generate-types:contracts", + "generate-types": "yarn generate-types:contracts && yarn generate-types:spendingLimit", "generate-types:contracts": "cross-env typechain --target=web3-v1 --outDir './src/types/contracts' './node_modules/@gnosis.pm/safe-contracts/build/contracts/*.json'", + "generate-types:spendingLimit": "cross-env typechain --target=web3-v1 --outDir './src/types/contracts' ./src/logic/contracts/artifacts/*.json", "lint:check": "eslint './src/**/*.{js,jsx,ts,tsx}'", "lint:fix": "yarn lint:check --fix", "postinstall": "patch-package && electron-builder install-app-deps && yarn generate-types", diff --git a/src/components/Modal/index.tsx b/src/components/Modal/index.tsx index cae28d5b..40b6d1f7 100644 --- a/src/components/Modal/index.tsx +++ b/src/components/Modal/index.tsx @@ -1,52 +1,70 @@ import Modal from '@material-ui/core/Modal' -import { withStyles } from '@material-ui/core/styles' +import { makeStyles, createStyles } from '@material-ui/core/styles' import cn from 'classnames' -import * as React from 'react' +import React, { ReactElement, ReactNode } from 'react' import { sm } from 'src/theme/variables' -const styles = () => ({ - root: { - alignItems: 'center', - justifyContent: 'center', - display: 'flex', - overflowY: 'scroll', - }, - paper: { - position: 'absolute', - top: '120px', - width: '500px', - height: '540px', - borderRadius: sm, - backgroundColor: '#ffffff', - boxShadow: '0 0 5px 0 rgba(74, 85, 121, 0.5)', - '&:focus': { - outline: 'none', +const useStyles = makeStyles( + createStyles({ + root: { + alignItems: 'center', + justifyContent: 'center', + display: 'flex', + overflowY: 'scroll', }, - display: 'flex', - flexDirection: 'column', - }, -}) + paper: { + position: 'absolute', + top: '120px', + width: '500px', + height: '540px', + borderRadius: sm, + backgroundColor: '#ffffff', + boxShadow: '0 0 5px 0 rgba(74, 85, 121, 0.5)', + '&:focus': { + outline: 'none', + }, + display: 'flex', + flexDirection: 'column', + }, + }), +) + +interface GnoModalProps { + children: ReactNode + description: string + // type copied from Material-UI Modal's `close` prop + handleClose?: { + bivarianceHack(event: Record, reason: 'backdropClick' | 'escapeKeyDown'): void + }['bivarianceHack'] + modalClassName?: string + open: boolean + paperClassName?: string + title: string +} const GnoModal = ({ children, - classes, description, handleClose, modalClassName, open, paperClassName, title, -}: any) => ( - -
{children}
-
-) +}: GnoModalProps): ReactElement => { + const classes = useStyles() -export default withStyles(styles as any)(GnoModal) + return ( + +
{children}
+
+ ) +} + +export default GnoModal diff --git a/src/components/ScanQRModal/ScanQRWrapper/index.tsx b/src/components/ScanQRModal/ScanQRWrapper/index.tsx index 948c98be..110845ae 100644 --- a/src/components/ScanQRModal/ScanQRWrapper/index.tsx +++ b/src/components/ScanQRModal/ScanQRWrapper/index.tsx @@ -1,6 +1,5 @@ import { makeStyles } from '@material-ui/core/styles' -import { useState } from 'react' -import * as React from 'react' +import React, { ReactElement, useState } from 'react' import QRIcon from 'src/assets/icons/qrcode.svg' import { ScanQRModal } from 'src/components/ScanQRModal' @@ -16,7 +15,7 @@ type Props = { handleScan: (dataResult: string, closeQrModal: () => void) => void } -export const ScanQRWrapper = ({ handleScan }: Props): React.ReactElement => { +export const ScanQRWrapper = ({ handleScan }: Props): ReactElement => { const classes = useStyles() const [qrModalOpen, setQrModalOpen] = useState(false) diff --git a/src/logic/contracts/artifacts/AllowanceModule.json b/src/logic/contracts/artifacts/AllowanceModule.json new file mode 100644 index 00000000..72664b24 --- /dev/null +++ b/src/logic/contracts/artifacts/AllowanceModule.json @@ -0,0 +1,38072 @@ +{ + "contractName": "AllowanceModule", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "safe", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "delegate", + "type": "address" + } + ], + "name": "AddDelegate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "safe", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "delegate", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "DeleteAllowance", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "safe", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "delegate", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint96", + "name": "value", + "type": "uint96" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "nonce", + "type": "uint16" + } + ], + "name": "ExecuteAllowanceTransfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "safe", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "delegate", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "paymentToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "paymentReceiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint96", + "name": "payment", + "type": "uint96" + } + ], + "name": "PayAllowanceTransfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "safe", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "delegate", + "type": "address" + } + ], + "name": "RemoveDelegate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "safe", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "delegate", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "ResetAllowance", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "safe", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "delegate", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint96", + "name": "allowanceAmount", + "type": "uint96" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "resetTime", + "type": "uint16" + } + ], + "name": "SetAllowance", + "type": "event" + }, + { + "inputs": [], + "name": "ALLOWANCE_TRANSFER_TYPEHASH", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "DOMAIN_SEPARATOR_TYPEHASH", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "NAME", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "VERSION", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "allowances", + "outputs": [ + { + "internalType": "uint96", + "name": "amount", + "type": "uint96" + }, + { + "internalType": "uint96", + "name": "spent", + "type": "uint96" + }, + { + "internalType": "uint16", + "name": "resetTimeMin", + "type": "uint16" + }, + { + "internalType": "uint32", + "name": "lastResetMin", + "type": "uint32" + }, + { + "internalType": "uint16", + "name": "nonce", + "type": "uint16" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint48", + "name": "", + "type": "uint48" + } + ], + "name": "delegates", + "outputs": [ + { + "internalType": "address", + "name": "delegate", + "type": "address" + }, + { + "internalType": "uint48", + "name": "prev", + "type": "uint48" + }, + { + "internalType": "uint48", + "name": "next", + "type": "uint48" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "delegatesStart", + "outputs": [ + { + "internalType": "uint48", + "name": "", + "type": "uint48" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "tokens", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "delegate", + "type": "address" + }, + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint96", + "name": "allowanceAmount", + "type": "uint96" + }, + { + "internalType": "uint16", + "name": "resetTimeMin", + "type": "uint16" + }, + { + "internalType": "uint32", + "name": "resetBaseMin", + "type": "uint32" + } + ], + "name": "setAllowance", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "delegate", + "type": "address" + }, + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "resetAllowance", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "delegate", + "type": "address" + }, + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "deleteAllowance", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract GnosisSafe", + "name": "safe", + "type": "address" + }, + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address payable", + "name": "to", + "type": "address" + }, + { + "internalType": "uint96", + "name": "amount", + "type": "uint96" + }, + { + "internalType": "address", + "name": "paymentToken", + "type": "address" + }, + { + "internalType": "uint96", + "name": "payment", + "type": "uint96" + }, + { + "internalType": "address", + "name": "delegate", + "type": "address" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } + ], + "name": "executeAllowanceTransfer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getChainId", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "safe", + "type": "address" + }, + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint96", + "name": "amount", + "type": "uint96" + }, + { + "internalType": "address", + "name": "paymentToken", + "type": "address" + }, + { + "internalType": "uint96", + "name": "payment", + "type": "uint96" + }, + { + "internalType": "uint16", + "name": "nonce", + "type": "uint16" + } + ], + "name": "generateTransferHash", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "safe", + "type": "address" + }, + { + "internalType": "address", + "name": "delegate", + "type": "address" + } + ], + "name": "getTokens", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "safe", + "type": "address" + }, + { + "internalType": "address", + "name": "delegate", + "type": "address" + }, + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "getTokenAllowance", + "outputs": [ + { + "internalType": "uint256[5]", + "name": "", + "type": "uint256[5]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "delegate", + "type": "address" + } + ], + "name": "addDelegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "delegate", + "type": "address" + }, + { + "internalType": "bool", + "name": "removeAllowances", + "type": "bool" + } + ], + "name": "removeDelegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "safe", + "type": "address" + }, + { + "internalType": "uint48", + "name": "start", + "type": "uint48" + }, + { + "internalType": "uint8", + "name": "pageSize", + "type": "uint8" + } + ], + "name": "getDelegates", + "outputs": [ + { + "internalType": "address[]", + "name": "results", + "type": "address[]" + }, + { + "internalType": "uint48", + "name": "next", + "type": "uint48" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "metadata": "{\"compiler\":{\"version\":\"0.7.1+commit.f4a555be\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"safe\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"delegate\",\"type\":\"address\"}],\"name\":\"AddDelegate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"safe\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"delegate\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"DeleteAllowance\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"safe\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"delegate\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"value\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"nonce\",\"type\":\"uint16\"}],\"name\":\"ExecuteAllowanceTransfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"safe\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"delegate\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"paymentToken\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"paymentReceiver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"payment\",\"type\":\"uint96\"}],\"name\":\"PayAllowanceTransfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"safe\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"delegate\",\"type\":\"address\"}],\"name\":\"RemoveDelegate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"safe\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"delegate\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"ResetAllowance\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"safe\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"delegate\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"allowanceAmount\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"resetTime\",\"type\":\"uint16\"}],\"name\":\"SetAllowance\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"ALLOWANCE_TRANSFER_TYPEHASH\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"DOMAIN_SEPARATOR_TYPEHASH\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"NAME\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"VERSION\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegate\",\"type\":\"address\"}],\"name\":\"addDelegate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"allowances\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"spent\",\"type\":\"uint96\"},{\"internalType\":\"uint16\",\"name\":\"resetTimeMin\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"lastResetMin\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"nonce\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint48\",\"name\":\"\",\"type\":\"uint48\"}],\"name\":\"delegates\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"delegate\",\"type\":\"address\"},{\"internalType\":\"uint48\",\"name\":\"prev\",\"type\":\"uint48\"},{\"internalType\":\"uint48\",\"name\":\"next\",\"type\":\"uint48\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"delegatesStart\",\"outputs\":[{\"internalType\":\"uint48\",\"name\":\"\",\"type\":\"uint48\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegate\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"deleteAllowance\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract GnosisSafe\",\"name\":\"safe\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address payable\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"address\",\"name\":\"paymentToken\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"payment\",\"type\":\"uint96\"},{\"internalType\":\"address\",\"name\":\"delegate\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"executeAllowanceTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"safe\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"address\",\"name\":\"paymentToken\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"payment\",\"type\":\"uint96\"},{\"internalType\":\"uint16\",\"name\":\"nonce\",\"type\":\"uint16\"}],\"name\":\"generateTransferHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getChainId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"safe\",\"type\":\"address\"},{\"internalType\":\"uint48\",\"name\":\"start\",\"type\":\"uint48\"},{\"internalType\":\"uint8\",\"name\":\"pageSize\",\"type\":\"uint8\"}],\"name\":\"getDelegates\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"results\",\"type\":\"address[]\"},{\"internalType\":\"uint48\",\"name\":\"next\",\"type\":\"uint48\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"safe\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"delegate\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"getTokenAllowance\",\"outputs\":[{\"internalType\":\"uint256[5]\",\"name\":\"\",\"type\":\"uint256[5]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"safe\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"delegate\",\"type\":\"address\"}],\"name\":\"getTokens\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegate\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"removeAllowances\",\"type\":\"bool\"}],\"name\":\"removeDelegate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegate\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"resetAllowance\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegate\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"allowanceAmount\",\"type\":\"uint96\"},{\"internalType\":\"uint16\",\"name\":\"resetTimeMin\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"resetBaseMin\",\"type\":\"uint32\"}],\"name\":\"setAllowance\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"tokens\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"addDelegate(address)\":{\"details\":\"Allows to add a delegate.\",\"params\":{\"delegate\":\"Delegate that should be added.\"}},\"deleteAllowance(address,address)\":{\"details\":\"Allows to remove the allowance for a specific delegate and token. This will set all values except the `nonce` to 0.\",\"params\":{\"delegate\":\"Delegate whose allowance should be updated.\",\"token\":\"Token contract address.\"}},\"executeAllowanceTransfer(address,address,address,uint96,address,uint96,address,bytes)\":{\"details\":\"Allows to use the allowance to perform a transfer.\",\"params\":{\"amount\":\"Amount that should be transferred.\",\"delegate\":\"Delegate whose allowance should be updated.\",\"payment\":\"Amount to should be paid for executing the transfer.\",\"paymentToken\":\"Token that should be used to pay for the execution of the transfer.\",\"safe\":\"The Safe whose funds should be used.\",\"signature\":\"Signature generated by the delegate to authorize the transfer.\",\"to\":\"Address that should receive the tokens.\",\"token\":\"Token contract address.\"}},\"generateTransferHash(address,address,address,uint96,address,uint96,uint16)\":{\"details\":\"Generates the transfer hash that should be signed to authorize a transfer\"},\"getChainId()\":{\"details\":\"Returns the chain id used by this contract.\"},\"removeDelegate(address,bool)\":{\"details\":\"Allows to remove a delegate.\",\"params\":{\"delegate\":\"Delegate that should be removed.\",\"removeAllowances\":\"Indicator if allowances should also be removed. This should be set to `true` unless this causes an out of gas, in this case the allowances should be \\\"manually\\\" deleted via `deleteAllowance`.\"}},\"resetAllowance(address,address)\":{\"details\":\"Allows to reset the allowance for a specific delegate and token.\",\"params\":{\"delegate\":\"Delegate whose allowance should be updated.\",\"token\":\"Token contract address.\"}},\"setAllowance(address,address,uint96,uint16,uint32)\":{\"details\":\"Allows to update the allowance for a specified token. This can only be done via a Safe transaction.\",\"params\":{\"allowanceAmount\":\"allowance in smallest token unit.\",\"delegate\":\"Delegate whose allowance should be updated.\",\"resetBaseMin\":\"Time based on which the reset time should be increased\",\"resetTimeMin\":\"Time after which the allowance should reset\",\"token\":\"Token contract address.\"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"/home/fer/repos/protofire/gnosis/safe-modules/allowances/contracts/AlowanceModule.sol\":\"AllowanceModule\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"/home/fer/repos/protofire/gnosis/safe-modules/allowances/contracts/AlowanceModule.sol\":{\"keccak256\":\"0xed6f4e2905b6a8db7fb78796508fe6960c013cb2042a2ea73cf078d531cc9344\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://b4f51be45551ac96510d2769817469c533ec8fae7756b249981ab2443be06f0f\",\"dweb:/ipfs/QmdffjxcbPKVZ7axEUUjjZCjua1cjHvCJqURSNAcEs3Wse\"]},\"/home/fer/repos/protofire/gnosis/safe-modules/allowances/contracts/Enum.sol\":{\"keccak256\":\"0xa15c9e6e366069b4477ea65de7ba06f32ff700396a322db449122889dd6d9df2\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://bd2141eb7313cff613a507ce3b4ed457be7152e184d597892055e02f21cf3c7a\",\"dweb:/ipfs/Qmeh5aLDdRrpTNbgGiXHfefcg3HtYDYKhd1QuXj4bE5CQk\"]},\"/home/fer/repos/protofire/gnosis/safe-modules/allowances/contracts/SignatureDecoder.sol\":{\"keccak256\":\"0xb26a989d4e56a911382da0d4f6ce6e51106533910b9dbb136234169a04688eff\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://5d09885b659d1c8cb5b5a7002982704254f250fe03720fb282b03540b4095d85\",\"dweb:/ipfs/QmfWMeJrG4viiNdj8GGXvD1miDDHZ6QeWrcC1sjoQxDPTW\"]}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b50613a98806100206000396000f3fe608060405234801561001057600080fd5b50600436106101215760003560e01c8063b713c9d4116100ad578063dd43a79f11610071578063dd43a79f1461093c578063e71bdf411461098c578063eb37abe0146109d0578063f56e81fa14610a97578063ffa1ad7414610b2f57610121565b8063b713c9d4146105cc578063beaeb388146106aa578063c19bf50e14610744578063ce60c692146107a8578063d626e0431461084657610121565b80634515641a116100f45780634515641a146101e0578063885133e31461036c5780638d0e8e1d146103d057806394b31fbd14610489578063a3f4df7e1461054957610121565b80631db61b5414610126578063310a3bb1146101445780633408e470146101a457806343abf5fe146101c2575b600080fd5b61012e610bb2565b6040518082815260200191505060405180910390f35b6101866004803603602081101561015a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bd9565b604051808265ffffffffffff16815260200191505060405180910390f35b6101ac610bfe565b6040518082815260200191505060405180910390f35b6101ca610c0b565b6040518082815260200191505060405180910390f35b61036a60048036036101008110156101f757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080356bffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080356bffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001906401000000008111156102e457600080fd5b8201836020820111156102f657600080fd5b8035906020019184600183028401116401000000008311171561031857600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050610c32565b005b6103ce6004803603604081101561038257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506110a1565b005b610432600480360360408110156103e657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111c9565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561047557808201518184015260208101905061045a565b505050509050019250505060405180910390f35b61050b6004803603606081101561049f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112d4565b6040518082600560200280838360005b8381101561053657808201518184015260208101905061051b565b5050505090500191505060405180910390f35b610551611360565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610591578082015181840152602081019050610576565b50505050905090810190601f1680156105be5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61064e600480360360608110156105e257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611399565b60405180866bffffffffffffffffffffffff168152602001856bffffffffffffffffffffffff1681526020018461ffff1681526020018363ffffffff1681526020018261ffff1681526020019550505050505060405180910390f35b610742600480360360a08110156106c057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080356bffffffffffffffffffffffff169060200190929190803561ffff169060200190929190803563ffffffff169060200190929190505050611445565b005b6107a66004803603604081101561075a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506118fe565b005b6107fc600480360360408110156107be57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803565ffffffffffff1690602001909291905050506119cf565b604051808473ffffffffffffffffffffffffffffffffffffffff1681526020018365ffffffffffff1681526020018265ffffffffffff168152602001935050505060405180910390f35b610926600480360360e081101561085c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080356bffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080356bffffffffffffffffffffffff169060200190929190803561ffff169060200190929190505050611a4a565b6040518082815260200191505060405180910390f35b61098a6004803603604081101561095257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190505050611a6f565b005b6109ce600480360360208110156109a257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506120ae565b005b610a31600480360360608110156109e657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803565ffffffffffff169060200190929190803560ff169060200190929190505050612581565b60405180806020018365ffffffffffff168152602001828103825284818151815260200191508051906020019060200280838360005b83811015610a82578082015181840152602081019050610a67565b50505050905001935050505060405180910390f35b610b0360048036036060811015610aad57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061293d565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610b37612995565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610b77578082015181840152602081019050610b5c565b50505050905090810190601f168015610ba45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b7f47e79534a245952e8b16893a336b85a3d9ea9fa8c573f3d803afb92a7946921860001b81565b60026020528060005260406000206000915054906101000a900465ffffffffffff1681565b6000804690508091505090565b7f80b006280932094e7cc965863eb5118dc07e5d272c6670c4a7c87299e04fceeb60001b81565b610c3a613855565b610c4589848a6129ce565b90506060610c5c8a8a8a8a8a8a8860800151612c2c565b90506001826080015101826080019061ffff16908161ffff1681525050600087836020015101905082602001516bffffffffffffffffffffffff16816bffffffffffffffffffffffff16118015610cd3575082600001516bffffffffffffffffffffffff16816bffffffffffffffffffffffff1611155b610d28576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603a8152602001806139ad603a913960400191505060405180910390fd5b8083602001906bffffffffffffffffffffffff1690816bffffffffffffffffffffffff16815250506000866bffffffffffffffffffffffff161115610ecd57610d6f613855565b8a73ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff1614610db257610dad8c878a6129ce565b610db4565b835b905086816020015101915080602001516bffffffffffffffffffffffff16826bffffffffffffffffffffffff16118015610e0e575080600001516bffffffffffffffffffffffff16826bffffffffffffffffffffffff1611155b610e63576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526048815260200180613a1b6048913960600191505060405180910390fd5b8181602001906bffffffffffffffffffffffff1690816bffffffffffffffffffffffff16815250508a73ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff1614610ecb57610eca8c878a84612e40565b5b505b610ed98b868c86612e40565b610ee58585848e612fdd565b6000866bffffffffffffffffffffffff161115610fbf57610f088b883289613130565b8a73ffffffffffffffffffffffffffffffffffffffff167fad71d7a737da41277b5ade17fd65b00671e3ab35f23778a98c8d925dc66e3d9d8689328a604051808573ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff168152602001826bffffffffffffffffffffffff16815260200194505050505060405180910390a25b610fcb8b8b8b8b613130565b8a73ffffffffffffffffffffffffffffffffffffffff167fa11cca2c2027e28ab0046aab4d4040f59d8b06e819ccd974c1e53e86aa814c19868c8c8c6001896080015103604051808673ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff168152602001836bffffffffffffffffffffffff1681526020018261ffff1681526020019550505050505060405180910390a25050505050505050505050565b6110a9613855565b6110b43384846129ce565b9050600081600001906bffffffffffffffffffffffff1690816bffffffffffffffffffffffff1681525050600081602001906bffffffffffffffffffffffff1690816bffffffffffffffffffffffff16815250506000816040019061ffff16908161ffff16815250506000816060019063ffffffff16908163ffffffff168152505061114233848484612e40565b3373ffffffffffffffffffffffffffffffffffffffff167f9a9bc79dd7e42545ba12d5659704d73a9364d4a18e0a98ca1c992a3bc999d2718484604051808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a2505050565b6060600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054806020026020016040519081016040528092919081815260200182805480156112c757602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001906001019080831161127d575b5050505050905092915050565b6112dc6138ae565b6112e4613855565b6112ef8585856129ce565b90506040518060a0016040528082600001516bffffffffffffffffffffffff16815260200182602001516bffffffffffffffffffffffff168152602001826040015161ffff168152602001826060015163ffffffff168152602001826080015161ffff168152509150509392505050565b6040518060400160405280601081526020017f416c6c6f77616e6365204d6f64756c650000000000000000000000000000000081525081565b600060205282600052604060002060205281600052604060002060205280600052604060002060009250925050508060000160009054906101000a90046bffffffffffffffffffffffff169080600001600c9054906101000a90046bffffffffffffffffffffffff16908060000160189054906101000a900461ffff169080600001601a9054906101000a900463ffffffff169080600001601e9054906101000a900461ffff16905085565b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614156114e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f64656c656761746520213d20616464726573732830290000000000000000000081525060200191505060405180910390fd5b8473ffffffffffffffffffffffffffffffffffffffff16600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008765ffffffffffff1665ffffffffffff16815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146115ef576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603c815260200180613918603c913960400191505060405180910390fd5b6115f7613855565b6116023387876129ce565b90506000816080015161ffff161415611708576001816080019061ffff16908161ffff1681525050600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020859080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b6000603c428161171457fe5b04905060008363ffffffff1611156117dc578063ffffffff168363ffffffff1611156117a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f7265736574426173654d696e203c3d2063757272656e744d696e00000000000081525060200191505060405180910390fd5b8361ffff1683820363ffffffff16816117bd57fe5b068103826060019063ffffffff16908163ffffffff1681525050611809565b6000826060015163ffffffff1614156118085780826060019063ffffffff16908163ffffffff16815250505b5b83826040019061ffff16908161ffff16815250508482600001906bffffffffffffffffffffffff1690816bffffffffffffffffffffffff168152505061185133888885612e40565b3373ffffffffffffffffffffffffffffffffffffffff167f49caa04c5e1e168069c09df7f88c07ca87be980b0bf4570ab77fe9aae3ca7eba88888888604051808573ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff168152602001836bffffffffffffffffffffffff1681526020018261ffff16815260200194505050505060405180910390a250505050505050565b611906613855565b6119113384846129ce565b9050600081602001906bffffffffffffffffffffffff1690816bffffffffffffffffffffffff168152505061194833848484612e40565b3373ffffffffffffffffffffffffffffffffffffffff167fa39af38687a2c1e52c987a84d807fd238b83b08a9da657f184a72fcd2b71360c8484604051808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a2505050565b6003602052816000526040600020602052806000526040600020600091509150508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060000160149054906101000a900465ffffffffffff169080600001601a9054906101000a900465ffffffffffff16905083565b6000611a5b88888888888888612c2c565b805190602001209050979650505050505050565b611a776138d0565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008465ffffffffffff1665ffffffffffff1681526020019081526020016000206040518060600160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a900465ffffffffffff1665ffffffffffff1665ffffffffffff16815260200160008201601a9054906101000a900465ffffffffffff1665ffffffffffff1665ffffffffffff16815250509050600073ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff161415611bd157506120aa565b8115611dd6576000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060005b8180549050811015611dd3576000828281548110611c7457fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050611ca9613855565b611cb43388846129ce565b9050600081600001906bffffffffffffffffffffffff1690816bffffffffffffffffffffffff1681525050600081602001906bffffffffffffffffffffffff1690816bffffffffffffffffffffffff16815250506000816040019061ffff16908161ffff16815250506000816060019063ffffffff16908163ffffffff1681525050611d4233888484612e40565b3373ffffffffffffffffffffffffffffffffffffffff167f9a9bc79dd7e42545ba12d5659704d73a9364d4a18e0a98ca1c992a3bc999d2718884604051808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a250508080600101915050611c5a565b50505b6000816020015165ffffffffffff161415611e56578060400151600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548165ffffffffffff021916908365ffffffffffff160217905550611ee5565b8060400151600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000836020015165ffffffffffff1665ffffffffffff168152602001908152602001600020600001601a6101000a81548165ffffffffffff021916908365ffffffffffff1602179055505b6000816040015165ffffffffffff1614611f88578060200151600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000836040015165ffffffffffff1665ffffffffffff16815260200190815260200160002060000160146101000a81548165ffffffffffff021916908365ffffffffffff1602179055505b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008465ffffffffffff1665ffffffffffff168152602001908152602001600020600080820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556000820160146101000a81549065ffffffffffff021916905560008201601a6101000a81549065ffffffffffff021916905550503373ffffffffffffffffffffffffffffffffffffffff167fdccc2d936ded24d2153d2760581a7f0dcb23ec71190c9726b3584cdd700214d484604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a2505b5050565b600081905060008165ffffffffffff161415612132576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f696e64657820213d2075696e742830290000000000000000000000000000000081525060200191505060405180910390fd5b6000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008365ffffffffffff1665ffffffffffff16815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614612296578273ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161461228f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f63757272656e7444656c6567617465203d3d2064656c6567617465000000000081525060200191505060405180910390fd5b505061257e565b6000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900465ffffffffffff16905060405180606001604052808573ffffffffffffffffffffffffffffffffffffffff168152602001600065ffffffffffff1681526020018265ffffffffffff16815250600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008565ffffffffffff1665ffffffffffff16815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160000160146101000a81548165ffffffffffff021916908365ffffffffffff160217905550604082015181600001601a6101000a81548165ffffffffffff021916908365ffffffffffff16021790555090505082600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008365ffffffffffff1665ffffffffffff16815260200190815260200160002060000160146101000a81548165ffffffffffff021916908365ffffffffffff16021790555082600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548165ffffffffffff021916908365ffffffffffff1602179055503373ffffffffffffffffffffffffffffffffffffffff167f2fd5b26f00131bd8ca0fc556207292b85a6bec241341df82724333227458e63085604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a25050505b50565b606060008260ff1667ffffffffffffffff8111801561259f57600080fd5b506040519080825280602002602001820160405280156125ce5781602001602082028036833780820191505090505b509150600080808665ffffffffffff16141561263b57600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900465ffffffffffff1661263d565b855b90506126476138d0565b600360008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008365ffffffffffff1665ffffffffffff1681526020019081526020016000206040518060600160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a900465ffffffffffff1665ffffffffffff1665ffffffffffff16815260200160008201601a9054906101000a900465ffffffffffff1665ffffffffffff1665ffffffffffff168152505090505b600073ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff16141580156127a957508560ff168360ff16105b15612928578060000151858460ff16815181106127c257fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508280600101935050600360008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000826040015165ffffffffffff1665ffffffffffff1681526020019081526020016000206040518060600160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a900465ffffffffffff1665ffffffffffff1665ffffffffffff16815260200160008201601a9054906101000a900465ffffffffffff1665ffffffffffff1665ffffffffffff16815250509050612763565b80600001519350828552505050935093915050565b6001602052826000526040600020602052816000526040600020818154811061296257fe5b90600052602060002001600092509250509054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040518060400160405280600581526020017f302e312e3000000000000000000000000000000000000000000000000000000081525081565b6129d6613855565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040518060a00160405290816000820160009054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff166bffffffffffffffffffffffff16815260200160008201600c9054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff166bffffffffffffffffffffffff1681526020016000820160189054906101000a900461ffff1661ffff1661ffff16815260200160008201601a9054906101000a900463ffffffff1663ffffffff1663ffffffff16815260200160008201601e9054906101000a900461ffff1661ffff1661ffff168152505090506000603c4281612b8957fe5b0490506000826040015161ffff16118015612bbe5750816040015161ffff16810363ffffffff16826060015163ffffffff1611155b15612c2457600082602001906bffffffffffffffffffffffff1690816bffffffffffffffffffffffff1681525050816040015161ffff168260600151820363ffffffff1681612c0957fe5b068103826060019063ffffffff16908163ffffffff16815250505b509392505050565b60606000612c38610bfe565b905060007f47e79534a245952e8b16893a336b85a3d9ea9fa8c573f3d803afb92a7946921860001b8230604051602001808481526020018381526020018273ffffffffffffffffffffffffffffffffffffffff168152602001935050505060405160208183030381529060405280519060200120905060007f80b006280932094e7cc965863eb5118dc07e5d272c6670c4a7c87299e04fceeb60001b8b8b8b8b8b8b8b604051602001808981526020018873ffffffffffffffffffffffffffffffffffffffff1681526020018773ffffffffffffffffffffffffffffffffffffffff1681526020018673ffffffffffffffffffffffffffffffffffffffff168152602001856bffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff168152602001836bffffffffffffffffffffffff1681526020018261ffff16815260200198505050505050505050604051602081830303815290604052805190602001209050601960f81b600160f81b838360405160200180857effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19168152600101847effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681526001018381526020018281526020019450505050506040516020818303038152906040529350505050979650505050505050565b806000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff160217905550602082015181600001600c6101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff16021790555060408201518160000160186101000a81548161ffff021916908361ffff160217905550606082015181600001601a6101000a81548163ffffffff021916908363ffffffff160217905550608082015181600001601e6101000a81548161ffff021916908361ffff16021790555090505050505050565b6000612fe98484613524565b90508073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161480156130d457508073ffffffffffffffffffffffffffffffffffffffff16600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008365ffffffffffff1665ffffffffffff16815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b613129576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260598152602001806139546059913960600191505060405180910390fd5b5050505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156132be578373ffffffffffffffffffffffffffffffffffffffff1663468721a7838360006040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff168152602001836bffffffffffffffffffffffff168152602001806020018360018111156131d857fe5b8152602001828103825260008152602001602001945050505050602060405180830381600087803b15801561320c57600080fd5b505af1158015613220573d6000803e3d6000fd5b505050506040513d602081101561323657600080fd5b81019080805190602001909291905050506132b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f436f756c64206e6f742065786563757465206574686572207472616e7366657281525060200191505060405180910390fd5b61351e565b60608282604051602401808373ffffffffffffffffffffffffffffffffffffffff168152602001826bffffffffffffffffffffffff168152602001925050506040516020818303038152906040527fa9059cbb000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090508473ffffffffffffffffffffffffffffffffffffffff1663468721a78560008460006040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff168152602001848152602001806020018360018111156133e357fe5b8152602001828103825284818151815260200191508051906020019080838360005b83811015613420578082015181840152602081019050613405565b50505050905090810190601f16801561344d5780820380516001836020036101000a031916815260200191505b5095505050505050602060405180830381600087803b15801561346f57600080fd5b505af1158015613483573d6000803e3d6000fd5b505050506040513d602081101561349957600080fd5b810190808051906020019092919050505061351c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f436f756c64206e6f74206578656375746520746f6b656e207472616e7366657281525060200191505060405180910390fd5b505b50505050565b6000808351141561353757339050613820565b60418351146135ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f7369676e6174757265732e6c656e677468203d3d20363500000000000000000081525060200191505060405180910390fd5b60008060006135be866000613826565b80935081945082955050505060008360ff161415613627576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260348152602001806139e76034913960400191505060405180910390fd5b60018360ff16141561363b57339350613779565b601e8360ff16111561370a576001858051906020012060405160200180807f19457468657265756d205369676e6564204d6573736167653a0a333200000000815250601c018281526020019150506040516020818303038152906040528051906020012060048503848460405160008152602001604052604051808581526020018460ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa1580156136f9573d6000803e3d6000fd5b505050602060405103519350613778565b6001858051906020012084848460405160008152602001604052604051808581526020018460ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa15801561376b573d6000803e3d6000fd5b5050506020604051035193505b5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141561381c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f6f776e657220213d20616464726573732830290000000000000000000000000081525060200191505060405180910390fd5b5050505b92915050565b60008060008360410260208101860151925060408101860151915060ff60418201870151169350509250925092565b6040518060a0016040528060006bffffffffffffffffffffffff16815260200160006bffffffffffffffffffffffff168152602001600061ffff168152602001600063ffffffff168152602001600061ffff1681525090565b6040518060a00160405280600590602082028036833780820191505090505090565b6040518060600160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600065ffffffffffff168152602001600065ffffffffffff168152509056fe64656c6567617465735b6d73672e73656e6465725d5b75696e7434382864656c6567617465295d2e64656c6567617465203d3d2064656c6567617465657870656374656444656c6567617465203d3d207369676e65722026262064656c6567617465735b616464726573732873616665295d5b75696e743438287369676e6572295d2e64656c6567617465203d3d207369676e65726e65775370656e74203e20616c6c6f77616e63652e7370656e74202626206e65775370656e74203c3d20616c6c6f77616e63652e616d6f756e74436f6e7472616374207369676e61747572657320617265206e6f7420737570706f727465642062792074686973206d6f64756c656e65775370656e74203e207061796d656e74416c6c6f77616e63652e7370656e74202626206e65775370656e74203c3d207061796d656e74416c6c6f77616e63652e616d6f756e74a26469706673582212208a2846ee32dc079a0bad3b0fd56b368cddc175a616dcdd81307e8555c23d4e6464736f6c63430007010033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101215760003560e01c8063b713c9d4116100ad578063dd43a79f11610071578063dd43a79f1461093c578063e71bdf411461098c578063eb37abe0146109d0578063f56e81fa14610a97578063ffa1ad7414610b2f57610121565b8063b713c9d4146105cc578063beaeb388146106aa578063c19bf50e14610744578063ce60c692146107a8578063d626e0431461084657610121565b80634515641a116100f45780634515641a146101e0578063885133e31461036c5780638d0e8e1d146103d057806394b31fbd14610489578063a3f4df7e1461054957610121565b80631db61b5414610126578063310a3bb1146101445780633408e470146101a457806343abf5fe146101c2575b600080fd5b61012e610bb2565b6040518082815260200191505060405180910390f35b6101866004803603602081101561015a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bd9565b604051808265ffffffffffff16815260200191505060405180910390f35b6101ac610bfe565b6040518082815260200191505060405180910390f35b6101ca610c0b565b6040518082815260200191505060405180910390f35b61036a60048036036101008110156101f757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080356bffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080356bffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001906401000000008111156102e457600080fd5b8201836020820111156102f657600080fd5b8035906020019184600183028401116401000000008311171561031857600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050610c32565b005b6103ce6004803603604081101561038257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506110a1565b005b610432600480360360408110156103e657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111c9565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561047557808201518184015260208101905061045a565b505050509050019250505060405180910390f35b61050b6004803603606081101561049f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112d4565b6040518082600560200280838360005b8381101561053657808201518184015260208101905061051b565b5050505090500191505060405180910390f35b610551611360565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610591578082015181840152602081019050610576565b50505050905090810190601f1680156105be5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61064e600480360360608110156105e257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611399565b60405180866bffffffffffffffffffffffff168152602001856bffffffffffffffffffffffff1681526020018461ffff1681526020018363ffffffff1681526020018261ffff1681526020019550505050505060405180910390f35b610742600480360360a08110156106c057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080356bffffffffffffffffffffffff169060200190929190803561ffff169060200190929190803563ffffffff169060200190929190505050611445565b005b6107a66004803603604081101561075a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506118fe565b005b6107fc600480360360408110156107be57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803565ffffffffffff1690602001909291905050506119cf565b604051808473ffffffffffffffffffffffffffffffffffffffff1681526020018365ffffffffffff1681526020018265ffffffffffff168152602001935050505060405180910390f35b610926600480360360e081101561085c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080356bffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080356bffffffffffffffffffffffff169060200190929190803561ffff169060200190929190505050611a4a565b6040518082815260200191505060405180910390f35b61098a6004803603604081101561095257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190505050611a6f565b005b6109ce600480360360208110156109a257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506120ae565b005b610a31600480360360608110156109e657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803565ffffffffffff169060200190929190803560ff169060200190929190505050612581565b60405180806020018365ffffffffffff168152602001828103825284818151815260200191508051906020019060200280838360005b83811015610a82578082015181840152602081019050610a67565b50505050905001935050505060405180910390f35b610b0360048036036060811015610aad57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061293d565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610b37612995565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610b77578082015181840152602081019050610b5c565b50505050905090810190601f168015610ba45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b7f47e79534a245952e8b16893a336b85a3d9ea9fa8c573f3d803afb92a7946921860001b81565b60026020528060005260406000206000915054906101000a900465ffffffffffff1681565b6000804690508091505090565b7f80b006280932094e7cc965863eb5118dc07e5d272c6670c4a7c87299e04fceeb60001b81565b610c3a613855565b610c4589848a6129ce565b90506060610c5c8a8a8a8a8a8a8860800151612c2c565b90506001826080015101826080019061ffff16908161ffff1681525050600087836020015101905082602001516bffffffffffffffffffffffff16816bffffffffffffffffffffffff16118015610cd3575082600001516bffffffffffffffffffffffff16816bffffffffffffffffffffffff1611155b610d28576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603a8152602001806139ad603a913960400191505060405180910390fd5b8083602001906bffffffffffffffffffffffff1690816bffffffffffffffffffffffff16815250506000866bffffffffffffffffffffffff161115610ecd57610d6f613855565b8a73ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff1614610db257610dad8c878a6129ce565b610db4565b835b905086816020015101915080602001516bffffffffffffffffffffffff16826bffffffffffffffffffffffff16118015610e0e575080600001516bffffffffffffffffffffffff16826bffffffffffffffffffffffff1611155b610e63576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526048815260200180613a1b6048913960600191505060405180910390fd5b8181602001906bffffffffffffffffffffffff1690816bffffffffffffffffffffffff16815250508a73ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff1614610ecb57610eca8c878a84612e40565b5b505b610ed98b868c86612e40565b610ee58585848e612fdd565b6000866bffffffffffffffffffffffff161115610fbf57610f088b883289613130565b8a73ffffffffffffffffffffffffffffffffffffffff167fad71d7a737da41277b5ade17fd65b00671e3ab35f23778a98c8d925dc66e3d9d8689328a604051808573ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff168152602001826bffffffffffffffffffffffff16815260200194505050505060405180910390a25b610fcb8b8b8b8b613130565b8a73ffffffffffffffffffffffffffffffffffffffff167fa11cca2c2027e28ab0046aab4d4040f59d8b06e819ccd974c1e53e86aa814c19868c8c8c6001896080015103604051808673ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff168152602001836bffffffffffffffffffffffff1681526020018261ffff1681526020019550505050505060405180910390a25050505050505050505050565b6110a9613855565b6110b43384846129ce565b9050600081600001906bffffffffffffffffffffffff1690816bffffffffffffffffffffffff1681525050600081602001906bffffffffffffffffffffffff1690816bffffffffffffffffffffffff16815250506000816040019061ffff16908161ffff16815250506000816060019063ffffffff16908163ffffffff168152505061114233848484612e40565b3373ffffffffffffffffffffffffffffffffffffffff167f9a9bc79dd7e42545ba12d5659704d73a9364d4a18e0a98ca1c992a3bc999d2718484604051808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a2505050565b6060600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054806020026020016040519081016040528092919081815260200182805480156112c757602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001906001019080831161127d575b5050505050905092915050565b6112dc6138ae565b6112e4613855565b6112ef8585856129ce565b90506040518060a0016040528082600001516bffffffffffffffffffffffff16815260200182602001516bffffffffffffffffffffffff168152602001826040015161ffff168152602001826060015163ffffffff168152602001826080015161ffff168152509150509392505050565b6040518060400160405280601081526020017f416c6c6f77616e6365204d6f64756c650000000000000000000000000000000081525081565b600060205282600052604060002060205281600052604060002060205280600052604060002060009250925050508060000160009054906101000a90046bffffffffffffffffffffffff169080600001600c9054906101000a90046bffffffffffffffffffffffff16908060000160189054906101000a900461ffff169080600001601a9054906101000a900463ffffffff169080600001601e9054906101000a900461ffff16905085565b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614156114e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f64656c656761746520213d20616464726573732830290000000000000000000081525060200191505060405180910390fd5b8473ffffffffffffffffffffffffffffffffffffffff16600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008765ffffffffffff1665ffffffffffff16815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146115ef576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603c815260200180613918603c913960400191505060405180910390fd5b6115f7613855565b6116023387876129ce565b90506000816080015161ffff161415611708576001816080019061ffff16908161ffff1681525050600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020859080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b6000603c428161171457fe5b04905060008363ffffffff1611156117dc578063ffffffff168363ffffffff1611156117a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f7265736574426173654d696e203c3d2063757272656e744d696e00000000000081525060200191505060405180910390fd5b8361ffff1683820363ffffffff16816117bd57fe5b068103826060019063ffffffff16908163ffffffff1681525050611809565b6000826060015163ffffffff1614156118085780826060019063ffffffff16908163ffffffff16815250505b5b83826040019061ffff16908161ffff16815250508482600001906bffffffffffffffffffffffff1690816bffffffffffffffffffffffff168152505061185133888885612e40565b3373ffffffffffffffffffffffffffffffffffffffff167f49caa04c5e1e168069c09df7f88c07ca87be980b0bf4570ab77fe9aae3ca7eba88888888604051808573ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff168152602001836bffffffffffffffffffffffff1681526020018261ffff16815260200194505050505060405180910390a250505050505050565b611906613855565b6119113384846129ce565b9050600081602001906bffffffffffffffffffffffff1690816bffffffffffffffffffffffff168152505061194833848484612e40565b3373ffffffffffffffffffffffffffffffffffffffff167fa39af38687a2c1e52c987a84d807fd238b83b08a9da657f184a72fcd2b71360c8484604051808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a2505050565b6003602052816000526040600020602052806000526040600020600091509150508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060000160149054906101000a900465ffffffffffff169080600001601a9054906101000a900465ffffffffffff16905083565b6000611a5b88888888888888612c2c565b805190602001209050979650505050505050565b611a776138d0565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008465ffffffffffff1665ffffffffffff1681526020019081526020016000206040518060600160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a900465ffffffffffff1665ffffffffffff1665ffffffffffff16815260200160008201601a9054906101000a900465ffffffffffff1665ffffffffffff1665ffffffffffff16815250509050600073ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff161415611bd157506120aa565b8115611dd6576000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060005b8180549050811015611dd3576000828281548110611c7457fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050611ca9613855565b611cb43388846129ce565b9050600081600001906bffffffffffffffffffffffff1690816bffffffffffffffffffffffff1681525050600081602001906bffffffffffffffffffffffff1690816bffffffffffffffffffffffff16815250506000816040019061ffff16908161ffff16815250506000816060019063ffffffff16908163ffffffff1681525050611d4233888484612e40565b3373ffffffffffffffffffffffffffffffffffffffff167f9a9bc79dd7e42545ba12d5659704d73a9364d4a18e0a98ca1c992a3bc999d2718884604051808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a250508080600101915050611c5a565b50505b6000816020015165ffffffffffff161415611e56578060400151600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548165ffffffffffff021916908365ffffffffffff160217905550611ee5565b8060400151600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000836020015165ffffffffffff1665ffffffffffff168152602001908152602001600020600001601a6101000a81548165ffffffffffff021916908365ffffffffffff1602179055505b6000816040015165ffffffffffff1614611f88578060200151600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000836040015165ffffffffffff1665ffffffffffff16815260200190815260200160002060000160146101000a81548165ffffffffffff021916908365ffffffffffff1602179055505b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008465ffffffffffff1665ffffffffffff168152602001908152602001600020600080820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556000820160146101000a81549065ffffffffffff021916905560008201601a6101000a81549065ffffffffffff021916905550503373ffffffffffffffffffffffffffffffffffffffff167fdccc2d936ded24d2153d2760581a7f0dcb23ec71190c9726b3584cdd700214d484604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a2505b5050565b600081905060008165ffffffffffff161415612132576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f696e64657820213d2075696e742830290000000000000000000000000000000081525060200191505060405180910390fd5b6000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008365ffffffffffff1665ffffffffffff16815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614612296578273ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161461228f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f63757272656e7444656c6567617465203d3d2064656c6567617465000000000081525060200191505060405180910390fd5b505061257e565b6000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900465ffffffffffff16905060405180606001604052808573ffffffffffffffffffffffffffffffffffffffff168152602001600065ffffffffffff1681526020018265ffffffffffff16815250600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008565ffffffffffff1665ffffffffffff16815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160000160146101000a81548165ffffffffffff021916908365ffffffffffff160217905550604082015181600001601a6101000a81548165ffffffffffff021916908365ffffffffffff16021790555090505082600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008365ffffffffffff1665ffffffffffff16815260200190815260200160002060000160146101000a81548165ffffffffffff021916908365ffffffffffff16021790555082600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548165ffffffffffff021916908365ffffffffffff1602179055503373ffffffffffffffffffffffffffffffffffffffff167f2fd5b26f00131bd8ca0fc556207292b85a6bec241341df82724333227458e63085604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a25050505b50565b606060008260ff1667ffffffffffffffff8111801561259f57600080fd5b506040519080825280602002602001820160405280156125ce5781602001602082028036833780820191505090505b509150600080808665ffffffffffff16141561263b57600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900465ffffffffffff1661263d565b855b90506126476138d0565b600360008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008365ffffffffffff1665ffffffffffff1681526020019081526020016000206040518060600160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a900465ffffffffffff1665ffffffffffff1665ffffffffffff16815260200160008201601a9054906101000a900465ffffffffffff1665ffffffffffff1665ffffffffffff168152505090505b600073ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff16141580156127a957508560ff168360ff16105b15612928578060000151858460ff16815181106127c257fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508280600101935050600360008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000826040015165ffffffffffff1665ffffffffffff1681526020019081526020016000206040518060600160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a900465ffffffffffff1665ffffffffffff1665ffffffffffff16815260200160008201601a9054906101000a900465ffffffffffff1665ffffffffffff1665ffffffffffff16815250509050612763565b80600001519350828552505050935093915050565b6001602052826000526040600020602052816000526040600020818154811061296257fe5b90600052602060002001600092509250509054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040518060400160405280600581526020017f302e312e3000000000000000000000000000000000000000000000000000000081525081565b6129d6613855565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040518060a00160405290816000820160009054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff166bffffffffffffffffffffffff16815260200160008201600c9054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff166bffffffffffffffffffffffff1681526020016000820160189054906101000a900461ffff1661ffff1661ffff16815260200160008201601a9054906101000a900463ffffffff1663ffffffff1663ffffffff16815260200160008201601e9054906101000a900461ffff1661ffff1661ffff168152505090506000603c4281612b8957fe5b0490506000826040015161ffff16118015612bbe5750816040015161ffff16810363ffffffff16826060015163ffffffff1611155b15612c2457600082602001906bffffffffffffffffffffffff1690816bffffffffffffffffffffffff1681525050816040015161ffff168260600151820363ffffffff1681612c0957fe5b068103826060019063ffffffff16908163ffffffff16815250505b509392505050565b60606000612c38610bfe565b905060007f47e79534a245952e8b16893a336b85a3d9ea9fa8c573f3d803afb92a7946921860001b8230604051602001808481526020018381526020018273ffffffffffffffffffffffffffffffffffffffff168152602001935050505060405160208183030381529060405280519060200120905060007f80b006280932094e7cc965863eb5118dc07e5d272c6670c4a7c87299e04fceeb60001b8b8b8b8b8b8b8b604051602001808981526020018873ffffffffffffffffffffffffffffffffffffffff1681526020018773ffffffffffffffffffffffffffffffffffffffff1681526020018673ffffffffffffffffffffffffffffffffffffffff168152602001856bffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff168152602001836bffffffffffffffffffffffff1681526020018261ffff16815260200198505050505050505050604051602081830303815290604052805190602001209050601960f81b600160f81b838360405160200180857effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19168152600101847effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681526001018381526020018281526020019450505050506040516020818303038152906040529350505050979650505050505050565b806000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff160217905550602082015181600001600c6101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff16021790555060408201518160000160186101000a81548161ffff021916908361ffff160217905550606082015181600001601a6101000a81548163ffffffff021916908363ffffffff160217905550608082015181600001601e6101000a81548161ffff021916908361ffff16021790555090505050505050565b6000612fe98484613524565b90508073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161480156130d457508073ffffffffffffffffffffffffffffffffffffffff16600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008365ffffffffffff1665ffffffffffff16815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b613129576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260598152602001806139546059913960600191505060405180910390fd5b5050505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156132be578373ffffffffffffffffffffffffffffffffffffffff1663468721a7838360006040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff168152602001836bffffffffffffffffffffffff168152602001806020018360018111156131d857fe5b8152602001828103825260008152602001602001945050505050602060405180830381600087803b15801561320c57600080fd5b505af1158015613220573d6000803e3d6000fd5b505050506040513d602081101561323657600080fd5b81019080805190602001909291905050506132b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f436f756c64206e6f742065786563757465206574686572207472616e7366657281525060200191505060405180910390fd5b61351e565b60608282604051602401808373ffffffffffffffffffffffffffffffffffffffff168152602001826bffffffffffffffffffffffff168152602001925050506040516020818303038152906040527fa9059cbb000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090508473ffffffffffffffffffffffffffffffffffffffff1663468721a78560008460006040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff168152602001848152602001806020018360018111156133e357fe5b8152602001828103825284818151815260200191508051906020019080838360005b83811015613420578082015181840152602081019050613405565b50505050905090810190601f16801561344d5780820380516001836020036101000a031916815260200191505b5095505050505050602060405180830381600087803b15801561346f57600080fd5b505af1158015613483573d6000803e3d6000fd5b505050506040513d602081101561349957600080fd5b810190808051906020019092919050505061351c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f436f756c64206e6f74206578656375746520746f6b656e207472616e7366657281525060200191505060405180910390fd5b505b50505050565b6000808351141561353757339050613820565b60418351146135ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f7369676e6174757265732e6c656e677468203d3d20363500000000000000000081525060200191505060405180910390fd5b60008060006135be866000613826565b80935081945082955050505060008360ff161415613627576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260348152602001806139e76034913960400191505060405180910390fd5b60018360ff16141561363b57339350613779565b601e8360ff16111561370a576001858051906020012060405160200180807f19457468657265756d205369676e6564204d6573736167653a0a333200000000815250601c018281526020019150506040516020818303038152906040528051906020012060048503848460405160008152602001604052604051808581526020018460ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa1580156136f9573d6000803e3d6000fd5b505050602060405103519350613778565b6001858051906020012084848460405160008152602001604052604051808581526020018460ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa15801561376b573d6000803e3d6000fd5b5050506020604051035193505b5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141561381c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f6f776e657220213d20616464726573732830290000000000000000000000000081525060200191505060405180910390fd5b5050505b92915050565b60008060008360410260208101860151925060408101860151915060ff60418201870151169350509250925092565b6040518060a0016040528060006bffffffffffffffffffffffff16815260200160006bffffffffffffffffffffffff168152602001600061ffff168152602001600063ffffffff168152602001600061ffff1681525090565b6040518060a00160405280600590602082028036833780820191505090505090565b6040518060600160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600065ffffffffffff168152602001600065ffffffffffff168152509056fe64656c6567617465735b6d73672e73656e6465725d5b75696e7434382864656c6567617465295d2e64656c6567617465203d3d2064656c6567617465657870656374656444656c6567617465203d3d207369676e65722026262064656c6567617465735b616464726573732873616665295d5b75696e743438287369676e6572295d2e64656c6567617465203d3d207369676e65726e65775370656e74203e20616c6c6f77616e63652e7370656e74202626206e65775370656e74203c3d20616c6c6f77616e63652e616d6f756e74436f6e7472616374207369676e61747572657320617265206e6f7420737570706f727465642062792074686973206d6f64756c656e65775370656e74203e207061796d656e74416c6c6f77616e63652e7370656e74202626206e65775370656e74203c3d207061796d656e74416c6c6f77616e63652e616d6f756e74a26469706673582212208a2846ee32dc079a0bad3b0fd56b368cddc175a616dcdd81307e8555c23d4e6464736f6c63430007010033", + "immutableReferences": {}, + "sourceMap": "648:17265:0:-:0;;;;;;;;;;;;;;;;;;;", + "deployedSourceMap": "648:17265:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;801:118;;;:::i;:::-;;;;;;;;;;;;;;;;;;;1592:48;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;9986:219;;;:::i;:::-;;;;;;;;;;;;;;;;;;;1023:120;;;:::i;:::-;;;;;;;;;;;;;;;;;;;7570:2353;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;6536:419;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;14011:136;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;14153:427;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;700:48;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1337:88;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3430:1390;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;5985:303;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;1690:65;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;11015:366;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;15781:1365;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;14680:773;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;17152:759;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1465:64;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;754:40;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;801:118;853:66;801:118;;;:::o;1592:48::-;;;;;;;;;;;;;;;;;;;;;;:::o;9986:219::-;10029:7;10048:10;10161:9;10155:15;;10196:2;10189:9;;;9986:219;:::o;1023:120::-;1077:66;1023:120;;;:::o;7570:2353::-;7867:26;;:::i;:::-;7896:44;7917:4;7924:8;7934:5;7896:12;:44::i;:::-;7867:73;;7950:29;7982:98;8015:4;8022:5;8029:2;8033:6;8041:12;8055:7;8064:9;:15;;;7982:24;:98::i;:::-;7950:130;;8151:1;8133:9;:15;;;:19;8115:9;:15;;:37;;;;;;;;;;;8162:15;8198:6;8180:9;:15;;;:24;8162:42;;8280:9;:15;;;8269:26;;:8;:26;;;:58;;;;;8311:9;:16;;;8299:28;;:8;:28;;;;8269:58;8261:129;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8418:8;8400:9;:15;;:26;;;;;;;;;;;8450:1;8440:7;:11;;;8436:748;;;8543:33;;:::i;:::-;8595:5;8579:21;;:12;:21;;;:87;;8615:51;8636:4;8643:8;8653:12;8615;:51::i;:::-;8579:87;;;8603:9;8579:87;8543:123;;8716:7;8691:16;:22;;;:32;8680:43;;8807:16;:22;;;8796:33;;:8;:33;;;:72;;;;;8845:16;:23;;;8833:35;;:8;:35;;;;8796:72;8788:157;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8984:8;8959:16;:22;;:33;;;;;;;;;;;9094:5;9078:21;;:12;:21;;;9074:99;;9101:72;9125:4;9132:8;9142:12;9156:16;9101:15;:72::i;:::-;9074:99;8436:748;;9193:58;9217:4;9224:8;9234:5;9241:9;9193:15;:58::i;:::-;9330:59;9345:8;9355:9;9366:16;9384:4;9330:14;:59::i;:::-;9414:1;9404:7;:11;;;9400:344;;;9525:48;9534:4;9540:12;9554:9;9565:7;9525:8;:48::i;:::-;9683:4;9654:79;;;9690:8;9700:12;9714:9;9725:7;9654:79;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;9400:344;9779:33;9788:4;9794:5;9801:2;9805:6;9779:8;:33::i;:::-;9860:4;9827:89;;;9867:8;9877:5;9884:2;9888:6;9914:1;9896:9;:15;;;:19;9827:89;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7570:2353;;;;;;;;;;;:::o;6536:419::-;6623:26;;:::i;:::-;6652:41;6665:10;6677:8;6687:5;6652:12;:41::i;:::-;6623:70;;6722:1;6703:9;:16;;:20;;;;;;;;;;;6751:1;6733:9;:15;;:19;;;;;;;;;;;6787:1;6762:9;:22;;:26;;;;;;;;;;;6823:1;6798:9;:22;;:26;;;;;;;;;;;6834:55;6850:10;6862:8;6872:5;6879:9;6834:15;:55::i;:::-;6920:10;6904:44;;;6932:8;6942:5;6904:44;;;;;;;;;;;;;;;;;;;;;;;;;;;;6536:419;;;:::o;14011:136::-;14083:16;14118:6;:12;14125:4;14118:12;;;;;;;;;;;;;;;:22;14131:8;14118:22;;;;;;;;;;;;;;;14111:29;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;14011:136;;;;:::o;14153:427::-;14248:17;;:::i;:::-;14277:26;;:::i;:::-;14306:35;14319:4;14325:8;14335:5;14306:12;:35::i;:::-;14277:64;;14351:222;;;;;;;;14380:9;:16;;;14372:25;;14351:222;;;;14419:9;:15;;;14411:24;;14351:222;;;;14457:9;:22;;;14449:31;;14351:222;;;;14502:9;:22;;;14494:31;;14351:222;;;;14547:9;:15;;;14539:24;;14351:222;;;;;;14153:427;;;;;:::o;700:48::-;;;;;;;;;;;;;;;;;;;:::o;1337:88::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;3430:1390::-;3608:1;3588:22;;:8;:22;;;;3580:57;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3707:8;3655:60;;:9;:21;3665:10;3655:21;;;;;;;;;;;;;;;:39;3684:8;3655:39;;;;;;;;;;;;;;;:48;;;;;;;;;;;;:60;;;3647:133;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3790:26;;:::i;:::-;3819:41;3832:10;3844:8;3854:5;3819:12;:41::i;:::-;3790:70;;3893:1;3874:9;:15;;;:20;;;3870:210;;;4014:1;3996:9;:15;;:19;;;;;;;;;;;4029:6;:18;4036:10;4029:18;;;;;;;;;;;;;;;:28;4048:8;4029:28;;;;;;;;;;;;;;;4063:5;4029:40;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3870:210;4206:17;4251:2;4233:15;:20;;;;;;4206:48;;4283:1;4268:12;:16;;;4264:307;;;4324:10;4308:26;;:12;:26;;;;4300:65;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4448:12;4418:42;;4432:12;4419:10;:25;4418:42;;;;;;;;4404:10;:57;4379:9;:22;;:82;;;;;;;;;;;4264:307;;;4508:1;4482:9;:22;;;:27;;;4478:93;;;4550:10;4525:9;:22;;:35;;;;;;;;;;;4478:93;4264:307;4605:12;4580:9;:22;;:37;;;;;;;;;;;4646:15;4627:9;:16;;:34;;;;;;;;;;;4671:55;4687:10;4699:8;4709:5;4716:9;4671:15;:55::i;:::-;4754:10;4741:72;;;4766:8;4776:5;4783:15;4800:12;4741:72;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3430:1390;;;;;;;:::o;5985:303::-;6059:26;;:::i;:::-;6088:41;6101:10;6113:8;6123:5;6088:12;:41::i;:::-;6059:70;;6157:1;6139:9;:15;;:19;;;;;;;;;;;6168:55;6184:10;6196:8;6206:5;6213:9;6168:15;:55::i;:::-;6253:10;6238:43;;;6265:8;6275:5;6238:43;;;;;;;;;;;;;;;;;;;;;;;;;;;;5985:303;;;:::o;1690:65::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;11015:366::-;11236:7;11272:101;11310:4;11316:5;11323:2;11327:6;11335:12;11349:7;11358:5;11272:24;:101::i;:::-;11262:112;;;;;;11255:119;;11015:366;;;;;;;;;:::o;15781:1365::-;15863:23;;:::i;:::-;15889:9;:21;15899:10;15889:21;;;;;;;;;;;;;;;:39;15918:8;15889:39;;;;;;;;;;;;;;;15863:65;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;16019:1;15991:30;;:7;:16;;;:30;;;15988:42;;;16023:7;;;15988:42;16043:16;16039:698;;;16075:32;16110:6;:18;16117:10;16110:18;;;;;;;;;;;;;;;:28;16129:8;16110:28;;;;;;;;;;;;;;;16075:63;;16157:9;16152:575;16176:14;:21;;;;16172:1;:25;16152:575;;;16222:13;16238:14;16253:1;16238:17;;;;;;;;;;;;;;;;;;;;;;;;;16222:33;;16339:26;;:::i;:::-;16368:41;16381:10;16393:8;16403:5;16368:12;:41::i;:::-;16339:70;;16446:1;16427:9;:16;;:20;;;;;;;;;;;16483:1;16465:9;:15;;:19;;;;;;;;;;;16527:1;16502:9;:22;;:26;;;;;;;;;;;16571:1;16546:9;:22;;:26;;;;;;;;;;;16590:55;16606:10;16618:8;16628:5;16635:9;16590:15;:55::i;:::-;16684:10;16668:44;;;16696:8;16706:5;16668:44;;;;;;;;;;;;;;;;;;;;;;;;;;;;16152:575;;16199:3;;;;;;;16152:575;;;;16039:698;;16766:1;16750:7;:12;;;:17;;;16746:175;;;16812:7;:12;;;16783:14;:26;16798:10;16783:26;;;;;;;;;;;;;;;;:41;;;;;;;;;;;;;;;;;;16746:175;;;16898:7;:12;;;16855:9;:21;16865:10;16855:21;;;;;;;;;;;;;;;:35;16877:7;:12;;;16855:35;;;;;;;;;;;;;;;:40;;;:55;;;;;;;;;;;;;;;;;;16746:175;16950:1;16934:7;:12;;;:17;;;16930:103;;17010:7;:12;;;16967:9;:21;16977:10;16967:21;;;;;;;;;;;;;;;:35;16989:7;:12;;;16967:35;;;;;;;;;;;;;;;:40;;;:55;;;;;;;;;;;;;;;;;;16930:103;17049:9;:21;17059:10;17049:21;;;;;;;;;;;;;;;:39;17078:8;17049:39;;;;;;;;;;;;;;;;17042:46;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;17118:10;17103:36;;;17130:8;17103:36;;;;;;;;;;;;;;;;;;;;15781:1365;;;;:::o;14680:773::-;14736:12;14758:8;14736:31;;14799:1;14785:5;:16;;;;14777:45;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;14832:23;14858:9;:21;14868:10;14858:21;;;;;;;;;;;;;;;:28;14880:5;14858:28;;;;;;;;;;;;;;;:37;;;;;;;;;;;;14832:63;;14935:1;14908:29;;:15;:29;;;14905:264;;15044:8;15025:27;;:15;:27;;;15017:67;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;15152:7;;;;14905:264;15178:17;15198:14;:26;15213:10;15198:26;;;;;;;;;;;;;;;;;;;;;;;;;15178:46;;15265:33;;;;;;;;15274:8;15265:33;;;;;;15284:1;15265:33;;;;;;15287:10;15265:33;;;;;15234:9;:21;15244:10;15234:21;;;;;;;;;;;;;;;:28;15256:5;15234:28;;;;;;;;;;;;;;;:64;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;15349:5;15308:9;:21;15318:10;15308:21;;;;;;;;;;;;;;;:33;15330:10;15308:33;;;;;;;;;;;;;;;:38;;;:46;;;;;;;;;;;;;;;;;;15393:5;15364:14;:26;15379:10;15364:26;;;;;;;;;;;;;;;;:34;;;;;;;;;;;;;;;;;;15425:10;15413:33;;;15437:8;15413:33;;;;;;;;;;;;;;;;;;;;14680:773;;;;;:::o;17152:759::-;17239:24;17265:11;17312:8;17298:23;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;17288:33;;17331:7;17352:19;17384:1;17375:5;:10;;;;17374:43;;17397:14;:20;17412:4;17397:20;;;;;;;;;;;;;;;;;;;;;;;;;17374:43;;;17389:5;17374:43;17352:65;;17427:23;;:::i;:::-;17453:9;:15;17463:4;17453:15;;;;;;;;;;;;;;;:29;17469:12;17453:29;;;;;;;;;;;;;;;17427:55;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;17492:178;17526:1;17498:30;;:7;:16;;;:30;;;;:46;;;;;17536:8;17532:12;;:1;:12;;;17498:46;17492:178;;;17573:7;:16;;;17560:7;17568:1;17560:10;;;;;;;;;;;;;;;:29;;;;;;;;;;;17603:3;;;;;;;17630:9;:15;17640:4;17630:15;;;;;;;;;;;;;;;:29;17646:7;:12;;;17630:29;;;;;;;;;;;;;;;17620:39;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;17492:178;;;17693:7;:16;;;17679:31;;17893:1;17884:7;17877:18;17863:42;;;;;;;;;:::o;1465:64::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;754:40::-;;;;;;;;;;;;;;;;;;;:::o;4826:786::-;4917:26;;:::i;:::-;4967:10;:16;4978:4;4967:16;;;;;;;;;;;;;;;:26;4984:8;4967:26;;;;;;;;;;;;;;;:33;4994:5;4967:33;;;;;;;;;;;;;;;4955:45;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5072:17;5117:2;5099:15;:20;;;;;;5072:48;;5257:1;5232:9;:22;;;:26;;;:91;;;;;5301:9;:22;;;5288:35;;:10;:35;5262:61;;:9;:22;;;:61;;;;5232:91;5228:352;;;5357:1;5339:9;:15;;:19;;;;;;;;;;;5546:9;:22;;;5506:62;;5520:9;:22;;;5507:10;:35;5506:62;;;;;;;;5492:10;:77;5467:9;:22;;:102;;;;;;;;;;;5228:352;5589:16;4826:786;;;;;:::o;10288:634::-;10514:12;10538:15;10556:12;:10;:12::i;:::-;10538:30;;10578:23;853:66;10625:25;;10652:7;10661:4;10614:52;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;10604:63;;;;;;10578:89;;10677:20;1077:66;10734:27;;10763:4;10769:5;10776:2;10780:6;10788:12;10802:7;10811:5;10723:94;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;10700:127;;;;;;10677:150;;10866:4;10861:10;;10878:4;10873:10;;10885:15;10902:12;10844:71;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;10837:78;;;;;10288:634;;;;;;;;;:::o;5618:170::-;5772:9;5736:10;:16;5747:4;5736:16;;;;;;;;;;;;;;;:26;5753:8;5736:26;;;;;;;;;;;;;;;:33;5763:5;5736:33;;;;;;;;;;;;;;;:45;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5618:170;;;;:::o;11387:449::-;11532:14;11549:45;11566:9;11577:16;11549;:45::i;:::-;11532:62;;11645:6;11625:26;;:16;:26;;;:89;;;;;11708:6;11655:59;;:9;:24;11673:4;11655:24;;;;;;;;;;;;;;;:40;11687:6;11655:40;;;;;;;;;;;;;;;:49;;;;;;;;;;;;:59;;;11625:89;11604:225;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;11387:449;;;;;:::o;13436:569::-;13560:1;13543:19;;:5;:19;;;13539:460;;;13643:4;:30;;;13674:2;13678:6;13690:19;13643:67;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;13635:112;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;13539:460;;;13778:17;13851:2;13855:6;13798:64;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;13778:84;;13884:4;:30;;;13915:5;13922:1;13925:4;13931:19;13884:67;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;13876:112;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;13539:460;;13436:569;;;;:::o;11979:1451::-;12082:13;12198:1;12178:9;:16;:21;12174:44;;;12208:10;12201:17;;;;12174:44;12346:2;12326:9;:16;:22;12318:58;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;12386:7;12403:9;12422;12453:28;12468:9;12479:1;12453:14;:28::i;:::-;12441:40;;;;;;;;;;;;12553:1;12548;:6;;;12544:748;;;12570:62;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;12544:748;12658:1;12653;:6;;;12649:643;;;12801:10;12793:18;;12649:643;;;12836:2;12832:1;:6;;;12828:464;;;13010:116;13093:16;13083:27;;;;;;13030:81;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;13020:92;;;;;;13118:1;13114;:5;13121:1;13124;13010:116;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;13002:124;;12828:464;;;13234:47;13254:16;13244:27;;;;;;13273:1;13276;13279;13234:47;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;13226:55;;12828:464;12649:643;13397:1;13380:19;;:5;:19;;;;13372:51;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;11979:1451;;;;;;;;:::o;1264:921:3:-;1373:7;1382:9;1393;1693:3;1687:4;1683:14;1755:4;1741:12;1737:23;1725:10;1721:40;1715:47;1710:52;;1820:4;1806:12;1802:23;1790:10;1786:40;1780:47;1775:52;;2164:4;2155;2141:12;2137:23;2125:10;2121:40;2115:47;2111:58;2106:63;;1649:530;;;;;;:::o;-1:-1:-1:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o", + "source": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.8.0;\n\nimport \"./Enum.sol\";\nimport \"./SignatureDecoder.sol\";\n\ninterface GnosisSafe {\n /// @dev Allows a Module to execute a Safe transaction without any further confirmations.\n /// @param to Destination address of module transaction.\n /// @param value Ether value of module transaction.\n /// @param data Data payload of module transaction.\n /// @param operation Operation type of module transaction.\n function execTransactionFromModule(address to, uint256 value, bytes calldata data, Enum.Operation operation)\n external\n returns (bool success);\n}\n\ncontract AllowanceModule is SignatureDecoder {\n\n string public constant NAME = \"Allowance Module\";\n string public constant VERSION = \"0.1.0\";\n\n bytes32 public constant DOMAIN_SEPARATOR_TYPEHASH = 0x47e79534a245952e8b16893a336b85a3d9ea9fa8c573f3d803afb92a79469218;\n // keccak256(\n // \"EIP712Domain(uint256 chainId,address verifyingContract)\"\n // );\n\n bytes32 public constant ALLOWANCE_TRANSFER_TYPEHASH = 0x80b006280932094e7cc965863eb5118dc07e5d272c6670c4a7c87299e04fceeb;\n // keccak256(\n // \"AllowanceTransfer(address safe,address token,uint96 amount,address paymentToken,uint96 payment,uint16 nonce)\"\n // );\n\n // Safe -> Delegate -> Allowance\n mapping(address => mapping (address => mapping(address => Allowance))) public allowances;\n // Safe -> Delegate -> Tokens\n mapping(address => mapping (address => address[])) public tokens;\n // Safe -> Delegates double linked list entry points\n mapping(address => uint48) public delegatesStart;\n // Safe -> Delegates double linked list\n mapping(address => mapping (uint48 => Delegate)) public delegates;\n\n // We use a double linked list for the delegates. The id is the first 6 bytes. \n // To double check the address in case of collision, the address is part of the struct.\n struct Delegate {\n address delegate;\n uint48 prev;\n uint48 next;\n }\n\n // The allowance info is optimized to fit into one word of storage.\n struct Allowance {\n uint96 amount;\n uint96 spent;\n uint16 resetTimeMin; // Maximum reset time span is 65k minutes\n uint32 lastResetMin;\n uint16 nonce;\n }\n\n event AddDelegate(address indexed safe, address delegate);\n event RemoveDelegate(address indexed safe, address delegate);\n event ExecuteAllowanceTransfer(address indexed safe, address delegate, address token, address to, uint96 value, uint16 nonce);\n event PayAllowanceTransfer(address indexed safe, address delegate, address paymentToken, address paymentReceiver, uint96 payment);\n event SetAllowance(address indexed safe, address delegate, address token, uint96 allowanceAmount, uint16 resetTime);\n event ResetAllowance(address indexed safe, address delegate, address token);\n event DeleteAllowance(address indexed safe, address delegate, address token);\n\n /// @dev Allows to update the allowance for a specified token. This can only be done via a Safe transaction.\n /// @param delegate Delegate whose allowance should be updated.\n /// @param token Token contract address.\n /// @param allowanceAmount allowance in smallest token unit.\n /// @param resetTimeMin Time after which the allowance should reset\n /// @param resetBaseMin Time based on which the reset time should be increased\n function setAllowance(address delegate, address token, uint96 allowanceAmount, uint16 resetTimeMin, uint32 resetBaseMin)\n public\n {\n require(delegate != address(0), \"delegate != address(0)\");\n require(delegates[msg.sender][uint48(delegate)].delegate == delegate, \"delegates[msg.sender][uint48(delegate)].delegate == delegate\");\n Allowance memory allowance = getAllowance(msg.sender, delegate, token);\n if (allowance.nonce == 0) { // New token\n // Nonce should never be 0 once allowance has been activated\n allowance.nonce = 1;\n tokens[msg.sender][delegate].push(token);\n }\n // Divide by 60 to get current time in minutes\n // solium-disable-next-line security/no-block-members\n uint32 currentMin = uint32(block.timestamp / 60);\n if (resetBaseMin > 0) {\n require(resetBaseMin <= currentMin, \"resetBaseMin <= currentMin\");\n allowance.lastResetMin = currentMin - ((currentMin - resetBaseMin) % resetTimeMin);\n } else if (allowance.lastResetMin == 0) {\n allowance.lastResetMin = currentMin;\n }\n allowance.resetTimeMin = resetTimeMin;\n allowance.amount = allowanceAmount;\n updateAllowance(msg.sender, delegate, token, allowance);\n emit SetAllowance(msg.sender, delegate, token, allowanceAmount, resetTimeMin);\n }\n\n function getAllowance(address safe, address delegate, address token) private view returns (Allowance memory allowance) {\n allowance = allowances[safe][delegate][token];\n // solium-disable-next-line security/no-block-members\n uint32 currentMin = uint32(block.timestamp / 60);\n // Check if we should reset the time. We do this on load to minimize storage read/ writes\n if (allowance.resetTimeMin > 0 && allowance.lastResetMin <= currentMin - allowance.resetTimeMin) {\n allowance.spent = 0;\n // Resets happen in regular intervals and `lastResetMin` should be aligned to that\n allowance.lastResetMin = currentMin - ((currentMin - allowance.lastResetMin) % allowance.resetTimeMin);\n }\n return allowance;\n }\n\n function updateAllowance(address safe, address delegate, address token, Allowance memory allowance) private {\n allowances[safe][delegate][token] = allowance;\n }\n\n /// @dev Allows to reset the allowance for a specific delegate and token.\n /// @param delegate Delegate whose allowance should be updated.\n /// @param token Token contract address.\n function resetAllowance(address delegate, address token) public {\n Allowance memory allowance = getAllowance(msg.sender, delegate, token);\n allowance.spent = 0;\n updateAllowance(msg.sender, delegate, token, allowance);\n emit ResetAllowance(msg.sender, delegate, token);\n }\n\n /// @dev Allows to remove the allowance for a specific delegate and token. This will set all values except the `nonce` to 0.\n /// @param delegate Delegate whose allowance should be updated.\n /// @param token Token contract address.\n function deleteAllowance(address delegate, address token)\n public\n {\n Allowance memory allowance = getAllowance(msg.sender, delegate, token);\n allowance.amount = 0;\n allowance.spent = 0;\n allowance.resetTimeMin = 0;\n allowance.lastResetMin = 0;\n updateAllowance(msg.sender, delegate, token, allowance);\n emit DeleteAllowance(msg.sender, delegate, token);\n }\n\n /// @dev Allows to use the allowance to perform a transfer.\n /// @param safe The Safe whose funds should be used.\n /// @param token Token contract address.\n /// @param to Address that should receive the tokens.\n /// @param amount Amount that should be transferred.\n /// @param paymentToken Token that should be used to pay for the execution of the transfer.\n /// @param payment Amount to should be paid for executing the transfer.\n /// @param delegate Delegate whose allowance should be updated.\n /// @param signature Signature generated by the delegate to authorize the transfer.\n function executeAllowanceTransfer(\n GnosisSafe safe,\n address token,\n address payable to,\n uint96 amount,\n address paymentToken,\n uint96 payment,\n address delegate,\n bytes memory signature\n ) public {\n // Get current state\n Allowance memory allowance = getAllowance(address(safe), delegate, token);\n bytes memory transferHashData = generateTransferHashData(address(safe), token, to, amount, paymentToken, payment, allowance.nonce);\n\n // Update state\n allowance.nonce = allowance.nonce + 1;\n uint96 newSpent = allowance.spent + amount;\n // Check new spent amount and overflow\n require(newSpent > allowance.spent && newSpent <= allowance.amount, \"newSpent > allowance.spent && newSpent <= allowance.amount\");\n allowance.spent = newSpent;\n if (payment > 0) {\n // Use updated allowance if token and paymentToken are the same\n Allowance memory paymentAllowance = paymentToken == token ? allowance : getAllowance(address(safe), delegate, paymentToken);\n newSpent = paymentAllowance.spent + payment;\n // Check new spent amount and overflow\n require(newSpent > paymentAllowance.spent && newSpent <= paymentAllowance.amount, \"newSpent > paymentAllowance.spent && newSpent <= paymentAllowance.amount\");\n paymentAllowance.spent = newSpent;\n // Update payment allowance if different from allowance\n if (paymentToken != token) updateAllowance(address(safe), delegate, paymentToken, paymentAllowance);\n }\n updateAllowance(address(safe), delegate, token, allowance);\n\n // Perform external interactions\n // Check signature\n checkSignature(delegate, signature, transferHashData, safe);\n\n if (payment > 0) {\n // Transfer payment\n // solium-disable-next-line security/no-tx-origin\n transfer(safe, paymentToken, tx.origin, payment);\n // solium-disable-next-line security/no-tx-origin\n emit PayAllowanceTransfer(address(safe), delegate, paymentToken, tx.origin, payment);\n }\n // Transfer token\n transfer(safe, token, to, amount);\n emit ExecuteAllowanceTransfer(address(safe), delegate, token, to, amount, allowance.nonce - 1);\n }\n\n /// @dev Returns the chain id used by this contract.\n function getChainId() public pure returns (uint256) {\n uint256 id;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n id := chainid()\n }\n return id;\n }\n\n /// @dev Generates the data for the transfer hash (required for signing)\n function generateTransferHashData(\n address safe,\n address token,\n address to,\n uint96 amount,\n address paymentToken,\n uint96 payment,\n uint16 nonce\n ) private view returns (bytes memory) {\n uint256 chainId = getChainId();\n bytes32 domainSeparator = keccak256(abi.encode(DOMAIN_SEPARATOR_TYPEHASH, chainId, this));\n bytes32 transferHash = keccak256(\n abi.encode(ALLOWANCE_TRANSFER_TYPEHASH, safe, token, to, amount, paymentToken, payment, nonce)\n );\n return abi.encodePacked(byte(0x19), byte(0x01), domainSeparator, transferHash);\n }\n\n /// @dev Generates the transfer hash that should be signed to authorize a transfer\n function generateTransferHash(\n address safe,\n address token,\n address to,\n uint96 amount,\n address paymentToken,\n uint96 payment,\n uint16 nonce\n ) public view returns (bytes32) {\n return keccak256(generateTransferHashData(\n safe, token, to, amount, paymentToken, payment, nonce\n ));\n }\n\n function checkSignature(address expectedDelegate, bytes memory signature, bytes memory transferHashData, GnosisSafe safe) private view {\n address signer = recoverSignature(signature, transferHashData);\n require(\n expectedDelegate == signer && delegates[address(safe)][uint48(signer)].delegate == signer,\n \"expectedDelegate == signer && delegates[address(safe)][uint48(signer)].delegate == signer\"\n );\n }\n\n // We use the same format as used for the Safe contract, except that we only support exactly 1 signature and no contract signatures.\n function recoverSignature(bytes memory signature, bytes memory transferHashData) private view returns (address owner) {\n // If there is no signature data msg.sender should be used\n if (signature.length == 0) return msg.sender;\n // Check that the provided signature data is as long as 1 encoded ecsda signature\n require(signature.length == 65, \"signatures.length == 65\");\n uint8 v;\n bytes32 r;\n bytes32 s;\n (v, r, s) = signatureSplit(signature, 0);\n // If v is 0 then it is a contract signature\n if (v == 0) {\n revert(\"Contract signatures are not supported by this module\");\n } else if (v == 1) {\n // If v is 1 we also use msg.sender, this is so that we are compatible to the GnosisSafe signature scheme\n owner = msg.sender;\n } else if (v > 30) {\n // To support eth_sign and similar we adjust v and hash the transferHashData with the Ethereum message prefix before applying ecrecover\n owner = ecrecover(keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n32\", keccak256(transferHashData))), v - 4, r, s);\n } else {\n // Use ecrecover with the messageHash for EOA signatures\n owner = ecrecover(keccak256(transferHashData), v, r, s);\n }\n // 0 for the recovered owner indicates that an error happened.\n require(owner != address(0), \"owner != address(0)\");\n }\n\n function transfer(GnosisSafe safe, address token, address payable to, uint96 amount) private {\n if (token == address(0)) {\n // solium-disable-next-line security/no-send\n require(safe.execTransactionFromModule(to, amount, \"\", Enum.Operation.Call), \"Could not execute ether transfer\");\n } else {\n bytes memory data = abi.encodeWithSignature(\"transfer(address,uint256)\", to, amount);\n require(safe.execTransactionFromModule(token, 0, data, Enum.Operation.Call), \"Could not execute token transfer\");\n }\n }\n\n function getTokens(address safe, address delegate) public view returns (address[] memory) {\n return tokens[safe][delegate];\n }\n\n function getTokenAllowance(address safe, address delegate, address token) public view returns (uint256[5] memory) {\n Allowance memory allowance = getAllowance(safe, delegate, token);\n return [\n uint256(allowance.amount),\n uint256(allowance.spent),\n uint256(allowance.resetTimeMin),\n uint256(allowance.lastResetMin),\n uint256(allowance.nonce)\n ];\n }\n\n /// @dev Allows to add a delegate.\n /// @param delegate Delegate that should be added.\n function addDelegate(address delegate) public {\n uint48 index = uint48(delegate);\n require(index != uint(0), \"index != uint(0)\");\n address currentDelegate = delegates[msg.sender][index].delegate;\n if(currentDelegate != address(0)) {\n // We have a collision for the indices of delegates\n require(currentDelegate == delegate, \"currentDelegate == delegate\");\n // Delegate already exists, nothing to do\n return;\n }\n uint48 startIndex = delegatesStart[msg.sender];\n delegates[msg.sender][index] = Delegate(delegate, 0, startIndex);\n delegates[msg.sender][startIndex].prev = index;\n delegatesStart[msg.sender] = index;\n emit AddDelegate(msg.sender, delegate);\n }\n\n /// @dev Allows to remove a delegate.\n /// @param delegate Delegate that should be removed.\n /// @param removeAllowances Indicator if allowances should also be removed. This should be set to `true` unless this causes an out of gas, in this case the allowances should be \"manually\" deleted via `deleteAllowance`.\n function removeDelegate(address delegate, bool removeAllowances) public {\n Delegate memory current = delegates[msg.sender][uint48(delegate)];\n // Delegate doesn't exists, nothing to do\n if(current.delegate == address(0)) return;\n if (removeAllowances) {\n address[] storage delegateTokens = tokens[msg.sender][delegate];\n for (uint256 i = 0; i < delegateTokens.length; i++) {\n address token = delegateTokens[i];\n // Set all allowance params except the nonce to 0\n Allowance memory allowance = getAllowance(msg.sender, delegate, token);\n allowance.amount = 0;\n allowance.spent = 0;\n allowance.resetTimeMin = 0;\n allowance.lastResetMin = 0;\n updateAllowance(msg.sender, delegate, token, allowance);\n emit DeleteAllowance(msg.sender, delegate, token);\n }\n }\n if (current.prev == 0) {\n delegatesStart[msg.sender] = current.next;\n } else {\n delegates[msg.sender][current.prev].next = current.next;\n }\n if (current.next != 0) {\n delegates[msg.sender][current.next].prev = current.prev;\n }\n delete delegates[msg.sender][uint48(delegate)];\n emit RemoveDelegate(msg.sender, delegate);\n }\n\n function getDelegates(address safe, uint48 start, uint8 pageSize) public view returns (address[] memory results, uint48 next) {\n results = new address[](pageSize);\n uint8 i = 0;\n uint48 initialIndex = (start != 0) ? start : delegatesStart[safe];\n Delegate memory current = delegates[safe][initialIndex];\n while(current.delegate != address(0) && i < pageSize) {\n results[i] = current.delegate;\n i++;\n current = delegates[safe][current.next];\n }\n next = uint48(current.delegate);\n // Set the length of the array the number that has been used.\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n mstore(results, i)\n }\n }\n}", + "sourcePath": "/home/fer/repos/protofire/gnosis/safe-modules/allowances/contracts/AlowanceModule.sol", + "ast": { + "absolutePath": "/home/fer/repos/protofire/gnosis/safe-modules/allowances/contracts/AlowanceModule.sol", + "exportedSymbols": { + "AllowanceModule": [ + 1428 + ], + "GnosisSafe": [ + 18 + ] + }, + "id": 1429, + "license": "LGPL-3.0-only", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 1, + "literals": [ + "solidity", + ">=", + "0.7", + ".0", + "<", + "0.8", + ".0" + ], + "nodeType": "PragmaDirective", + "src": "42:31:0" + }, + { + "absolutePath": "/home/fer/repos/protofire/gnosis/safe-modules/allowances/contracts/Enum.sol", + "file": "./Enum.sol", + "id": 2, + "nodeType": "ImportDirective", + "scope": 1429, + "sourceUnit": 1436, + "src": "75:20:0", + "symbolAliases": [], + "unitAlias": "" + }, + { + "absolutePath": "/home/fer/repos/protofire/gnosis/safe-modules/allowances/contracts/SignatureDecoder.sol", + "file": "./SignatureDecoder.sol", + "id": 3, + "nodeType": "ImportDirective", + "scope": 1429, + "sourceUnit": 1552, + "src": "96:32:0", + "symbolAliases": [], + "unitAlias": "" + }, + { + "abstract": false, + "baseContracts": [], + "contractDependencies": [], + "contractKind": "interface", + "fullyImplemented": false, + "id": 18, + "linearizedBaseContracts": [ + 18 + ], + "name": "GnosisSafe", + "nodeType": "ContractDefinition", + "nodes": [ + { + "documentation": { + "id": 4, + "nodeType": "StructuredDocumentation", + "src": "157:325:0", + "text": "@dev Allows a Module to execute a Safe transaction without any further confirmations.\n @param to Destination address of module transaction.\n @param value Ether value of module transaction.\n @param data Data payload of module transaction.\n @param operation Operation type of module transaction." + }, + "functionSelector": "468721a7", + "id": 17, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "execTransactionFromModule", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 13, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 6, + "mutability": "mutable", + "name": "to", + "nodeType": "VariableDeclaration", + "scope": 17, + "src": "522:10:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 5, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "522:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 8, + "mutability": "mutable", + "name": "value", + "nodeType": "VariableDeclaration", + "scope": 17, + "src": "534:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 7, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "534:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 10, + "mutability": "mutable", + "name": "data", + "nodeType": "VariableDeclaration", + "scope": 17, + "src": "549:19:0", + "stateVariable": false, + "storageLocation": "calldata", + "typeDescriptions": { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 9, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "549:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 12, + "mutability": "mutable", + "name": "operation", + "nodeType": "VariableDeclaration", + "scope": 17, + "src": "570:24:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Operation_$1434", + "typeString": "enum Enum.Operation" + }, + "typeName": { + "id": 11, + "name": "Enum.Operation", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 1434, + "src": "570:14:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Operation_$1434", + "typeString": "enum Enum.Operation" + } + }, + "visibility": "internal" + } + ], + "src": "521:74:0" + }, + "returnParameters": { + "id": 16, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15, + "mutability": "mutable", + "name": "success", + "nodeType": "VariableDeclaration", + "scope": 17, + "src": "630:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 14, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "630:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "629:14:0" + }, + "scope": 18, + "src": "487:157:0", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + } + ], + "scope": 1429, + "src": "130:516:0" + }, + { + "abstract": false, + "baseContracts": [ + { + "baseName": { + "id": 19, + "name": "SignatureDecoder", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 1551, + "src": "676:16:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_SignatureDecoder_$1551", + "typeString": "contract SignatureDecoder" + } + }, + "id": 20, + "nodeType": "InheritanceSpecifier", + "src": "676:16:0" + } + ], + "contractDependencies": [ + 1551 + ], + "contractKind": "contract", + "fullyImplemented": true, + "id": 1428, + "linearizedBaseContracts": [ + 1428, + 1551 + ], + "name": "AllowanceModule", + "nodeType": "ContractDefinition", + "nodes": [ + { + "constant": true, + "functionSelector": "a3f4df7e", + "id": 23, + "mutability": "constant", + "name": "NAME", + "nodeType": "VariableDeclaration", + "scope": 1428, + "src": "700:48:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 21, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "700:6:0", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "value": { + "hexValue": "416c6c6f77616e6365204d6f64756c65", + "id": 22, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "730:18:0", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_08f58094bad74d8c1150a9739fed54fd2f5fa3e2ab1381a21213c5b33d83bad3", + "typeString": "literal_string \"Allowance Module\"" + }, + "value": "Allowance Module" + }, + "visibility": "public" + }, + { + "constant": true, + "functionSelector": "ffa1ad74", + "id": 26, + "mutability": "constant", + "name": "VERSION", + "nodeType": "VariableDeclaration", + "scope": 1428, + "src": "754:40:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 24, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "754:6:0", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "value": { + "hexValue": "302e312e30", + "id": 25, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "787:7:0", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_aa7cdbe2cce2ec7b606b0e199ddd9b264a6e645e767fb8479a7917dcd1b8693f", + "typeString": "literal_string \"0.1.0\"" + }, + "value": "0.1.0" + }, + "visibility": "public" + }, + { + "constant": true, + "functionSelector": "1db61b54", + "id": 29, + "mutability": "constant", + "name": "DOMAIN_SEPARATOR_TYPEHASH", + "nodeType": "VariableDeclaration", + "scope": 1428, + "src": "801:118:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 27, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "801:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": { + "hexValue": "307834376537393533346132343539353265386231363839336133333662383561336439656139666138633537336633643830336166623932613739343639323138", + "id": 28, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "853:66:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_32523383700587834770323112271211932718128200013265661849047136999858837557784_by_1", + "typeString": "int_const 3252...(69 digits omitted)...7784" + }, + "value": "0x47e79534a245952e8b16893a336b85a3d9ea9fa8c573f3d803afb92a79469218" + }, + "visibility": "public" + }, + { + "constant": true, + "functionSelector": "43abf5fe", + "id": 32, + "mutability": "constant", + "name": "ALLOWANCE_TRANSFER_TYPEHASH", + "nodeType": "VariableDeclaration", + "scope": 1428, + "src": "1023:120:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 30, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1023:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": { + "hexValue": "307838306230303632383039333230393465376363393635383633656235313138646330376535643237326336363730633461376338373239396530346663656562", + "id": 31, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1077:66:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_58207052191903435170300093819667864394893463916847536691962682627702085635819_by_1", + "typeString": "int_const 5820...(69 digits omitted)...5819" + }, + "value": "0x80b006280932094e7cc965863eb5118dc07e5d272c6670c4a7c87299e04fceeb" + }, + "visibility": "public" + }, + { + "constant": false, + "functionSelector": "b713c9d4", + "id": 40, + "mutability": "mutable", + "name": "allowances", + "nodeType": "VariableDeclaration", + "scope": 1428, + "src": "1337:88:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_mapping$_t_address_$_t_struct$_Allowance_$75_storage_$_$_$", + "typeString": "mapping(address => mapping(address => mapping(address => struct AllowanceModule.Allowance)))" + }, + "typeName": { + "id": 39, + "keyType": { + "id": 33, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1345:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "1337:70:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_mapping$_t_address_$_t_struct$_Allowance_$75_storage_$_$_$", + "typeString": "mapping(address => mapping(address => mapping(address => struct AllowanceModule.Allowance)))" + }, + "valueType": { + "id": 38, + "keyType": { + "id": 34, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1365:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "1356:50:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_struct$_Allowance_$75_storage_$_$", + "typeString": "mapping(address => mapping(address => struct AllowanceModule.Allowance))" + }, + "valueType": { + "id": 37, + "keyType": { + "id": 35, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1384:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "1376:29:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Allowance_$75_storage_$", + "typeString": "mapping(address => struct AllowanceModule.Allowance)" + }, + "valueType": { + "id": 36, + "name": "Allowance", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 75, + "src": "1395:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_storage_ptr", + "typeString": "struct AllowanceModule.Allowance" + } + } + } + } + }, + "visibility": "public" + }, + { + "constant": false, + "functionSelector": "f56e81fa", + "id": 47, + "mutability": "mutable", + "name": "tokens", + "nodeType": "VariableDeclaration", + "scope": 1428, + "src": "1465:64:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_array$_t_address_$dyn_storage_$_$", + "typeString": "mapping(address => mapping(address => address[]))" + }, + "typeName": { + "id": 46, + "keyType": { + "id": 41, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1473:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "1465:50:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_array$_t_address_$dyn_storage_$_$", + "typeString": "mapping(address => mapping(address => address[]))" + }, + "valueType": { + "id": 45, + "keyType": { + "id": 42, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1493:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "1484:30:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_array$_t_address_$dyn_storage_$", + "typeString": "mapping(address => address[])" + }, + "valueType": { + "baseType": { + "id": 43, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1504:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 44, + "nodeType": "ArrayTypeName", + "src": "1504:9:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + } + } + } + }, + "visibility": "public" + }, + { + "constant": false, + "functionSelector": "310a3bb1", + "id": 51, + "mutability": "mutable", + "name": "delegatesStart", + "nodeType": "VariableDeclaration", + "scope": 1428, + "src": "1592:48:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint48_$", + "typeString": "mapping(address => uint48)" + }, + "typeName": { + "id": 50, + "keyType": { + "id": 48, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1600:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "1592:26:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint48_$", + "typeString": "mapping(address => uint48)" + }, + "valueType": { + "id": 49, + "name": "uint48", + "nodeType": "ElementaryTypeName", + "src": "1611:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + } + }, + "visibility": "public" + }, + { + "constant": false, + "functionSelector": "ce60c692", + "id": 57, + "mutability": "mutable", + "name": "delegates", + "nodeType": "VariableDeclaration", + "scope": 1428, + "src": "1690:65:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_uint48_$_t_struct$_Delegate_$64_storage_$_$", + "typeString": "mapping(address => mapping(uint48 => struct AllowanceModule.Delegate))" + }, + "typeName": { + "id": 56, + "keyType": { + "id": 52, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1698:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "1690:48:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_uint48_$_t_struct$_Delegate_$64_storage_$_$", + "typeString": "mapping(address => mapping(uint48 => struct AllowanceModule.Delegate))" + }, + "valueType": { + "id": 55, + "keyType": { + "id": 53, + "name": "uint48", + "nodeType": "ElementaryTypeName", + "src": "1718:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "nodeType": "Mapping", + "src": "1709:28:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint48_$_t_struct$_Delegate_$64_storage_$", + "typeString": "mapping(uint48 => struct AllowanceModule.Delegate)" + }, + "valueType": { + "id": 54, + "name": "Delegate", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 64, + "src": "1728:8:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$64_storage_ptr", + "typeString": "struct AllowanceModule.Delegate" + } + } + } + }, + "visibility": "public" + }, + { + "canonicalName": "AllowanceModule.Delegate", + "id": 64, + "members": [ + { + "constant": false, + "id": 59, + "mutability": "mutable", + "name": "delegate", + "nodeType": "VariableDeclaration", + "scope": 64, + "src": "1964:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 58, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1964:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 61, + "mutability": "mutable", + "name": "prev", + "nodeType": "VariableDeclaration", + "scope": 64, + "src": "1990:11:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + }, + "typeName": { + "id": 60, + "name": "uint48", + "nodeType": "ElementaryTypeName", + "src": "1990:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 63, + "mutability": "mutable", + "name": "next", + "nodeType": "VariableDeclaration", + "scope": 64, + "src": "2011:11:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + }, + "typeName": { + "id": 62, + "name": "uint48", + "nodeType": "ElementaryTypeName", + "src": "2011:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "visibility": "internal" + } + ], + "name": "Delegate", + "nodeType": "StructDefinition", + "scope": 1428, + "src": "1938:91:0", + "visibility": "public" + }, + { + "canonicalName": "AllowanceModule.Allowance", + "id": 75, + "members": [ + { + "constant": false, + "id": 66, + "mutability": "mutable", + "name": "amount", + "nodeType": "VariableDeclaration", + "scope": 75, + "src": "2134:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "typeName": { + "id": 65, + "name": "uint96", + "nodeType": "ElementaryTypeName", + "src": "2134:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 68, + "mutability": "mutable", + "name": "spent", + "nodeType": "VariableDeclaration", + "scope": 75, + "src": "2157:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "typeName": { + "id": 67, + "name": "uint96", + "nodeType": "ElementaryTypeName", + "src": "2157:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 70, + "mutability": "mutable", + "name": "resetTimeMin", + "nodeType": "VariableDeclaration", + "scope": 75, + "src": "2179:19:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + }, + "typeName": { + "id": 69, + "name": "uint16", + "nodeType": "ElementaryTypeName", + "src": "2179:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 72, + "mutability": "mutable", + "name": "lastResetMin", + "nodeType": "VariableDeclaration", + "scope": 75, + "src": "2250:19:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 71, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "2250:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 74, + "mutability": "mutable", + "name": "nonce", + "nodeType": "VariableDeclaration", + "scope": 75, + "src": "2279:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + }, + "typeName": { + "id": 73, + "name": "uint16", + "nodeType": "ElementaryTypeName", + "src": "2279:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "visibility": "internal" + } + ], + "name": "Allowance", + "nodeType": "StructDefinition", + "scope": 1428, + "src": "2107:191:0", + "visibility": "public" + }, + { + "anonymous": false, + "id": 81, + "name": "AddDelegate", + "nodeType": "EventDefinition", + "parameters": { + "id": 80, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 77, + "indexed": true, + "mutability": "mutable", + "name": "safe", + "nodeType": "VariableDeclaration", + "scope": 81, + "src": "2322:20:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 76, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2322:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 79, + "indexed": false, + "mutability": "mutable", + "name": "delegate", + "nodeType": "VariableDeclaration", + "scope": 81, + "src": "2344:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 78, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2344:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "2321:40:0" + }, + "src": "2304:58:0" + }, + { + "anonymous": false, + "id": 87, + "name": "RemoveDelegate", + "nodeType": "EventDefinition", + "parameters": { + "id": 86, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 83, + "indexed": true, + "mutability": "mutable", + "name": "safe", + "nodeType": "VariableDeclaration", + "scope": 87, + "src": "2388:20:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 82, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2388:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 85, + "indexed": false, + "mutability": "mutable", + "name": "delegate", + "nodeType": "VariableDeclaration", + "scope": 87, + "src": "2410:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 84, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2410:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "2387:40:0" + }, + "src": "2367:61:0" + }, + { + "anonymous": false, + "id": 101, + "name": "ExecuteAllowanceTransfer", + "nodeType": "EventDefinition", + "parameters": { + "id": 100, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 89, + "indexed": true, + "mutability": "mutable", + "name": "safe", + "nodeType": "VariableDeclaration", + "scope": 101, + "src": "2464:20:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 88, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2464:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 91, + "indexed": false, + "mutability": "mutable", + "name": "delegate", + "nodeType": "VariableDeclaration", + "scope": 101, + "src": "2486:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 90, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2486:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 93, + "indexed": false, + "mutability": "mutable", + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 101, + "src": "2504:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 92, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2504:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 95, + "indexed": false, + "mutability": "mutable", + "name": "to", + "nodeType": "VariableDeclaration", + "scope": 101, + "src": "2519:10:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 94, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2519:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 97, + "indexed": false, + "mutability": "mutable", + "name": "value", + "nodeType": "VariableDeclaration", + "scope": 101, + "src": "2531:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "typeName": { + "id": 96, + "name": "uint96", + "nodeType": "ElementaryTypeName", + "src": "2531:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 99, + "indexed": false, + "mutability": "mutable", + "name": "nonce", + "nodeType": "VariableDeclaration", + "scope": 101, + "src": "2545:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + }, + "typeName": { + "id": 98, + "name": "uint16", + "nodeType": "ElementaryTypeName", + "src": "2545:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "visibility": "internal" + } + ], + "src": "2463:95:0" + }, + "src": "2433:126:0" + }, + { + "anonymous": false, + "id": 113, + "name": "PayAllowanceTransfer", + "nodeType": "EventDefinition", + "parameters": { + "id": 112, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 103, + "indexed": true, + "mutability": "mutable", + "name": "safe", + "nodeType": "VariableDeclaration", + "scope": 113, + "src": "2591:20:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 102, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2591:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 105, + "indexed": false, + "mutability": "mutable", + "name": "delegate", + "nodeType": "VariableDeclaration", + "scope": 113, + "src": "2613:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 104, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2613:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 107, + "indexed": false, + "mutability": "mutable", + "name": "paymentToken", + "nodeType": "VariableDeclaration", + "scope": 113, + "src": "2631:20:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 106, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2631:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 109, + "indexed": false, + "mutability": "mutable", + "name": "paymentReceiver", + "nodeType": "VariableDeclaration", + "scope": 113, + "src": "2653:23:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 108, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2653:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 111, + "indexed": false, + "mutability": "mutable", + "name": "payment", + "nodeType": "VariableDeclaration", + "scope": 113, + "src": "2678:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "typeName": { + "id": 110, + "name": "uint96", + "nodeType": "ElementaryTypeName", + "src": "2678:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "visibility": "internal" + } + ], + "src": "2590:103:0" + }, + "src": "2564:130:0" + }, + { + "anonymous": false, + "id": 125, + "name": "SetAllowance", + "nodeType": "EventDefinition", + "parameters": { + "id": 124, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 115, + "indexed": true, + "mutability": "mutable", + "name": "safe", + "nodeType": "VariableDeclaration", + "scope": 125, + "src": "2718:20:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 114, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2718:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 117, + "indexed": false, + "mutability": "mutable", + "name": "delegate", + "nodeType": "VariableDeclaration", + "scope": 125, + "src": "2740:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 116, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2740:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 119, + "indexed": false, + "mutability": "mutable", + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 125, + "src": "2758:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 118, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2758:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 121, + "indexed": false, + "mutability": "mutable", + "name": "allowanceAmount", + "nodeType": "VariableDeclaration", + "scope": 125, + "src": "2773:22:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "typeName": { + "id": 120, + "name": "uint96", + "nodeType": "ElementaryTypeName", + "src": "2773:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 123, + "indexed": false, + "mutability": "mutable", + "name": "resetTime", + "nodeType": "VariableDeclaration", + "scope": 125, + "src": "2797:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + }, + "typeName": { + "id": 122, + "name": "uint16", + "nodeType": "ElementaryTypeName", + "src": "2797:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "visibility": "internal" + } + ], + "src": "2717:97:0" + }, + "src": "2699:116:0" + }, + { + "anonymous": false, + "id": 133, + "name": "ResetAllowance", + "nodeType": "EventDefinition", + "parameters": { + "id": 132, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 127, + "indexed": true, + "mutability": "mutable", + "name": "safe", + "nodeType": "VariableDeclaration", + "scope": 133, + "src": "2841:20:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 126, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2841:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 129, + "indexed": false, + "mutability": "mutable", + "name": "delegate", + "nodeType": "VariableDeclaration", + "scope": 133, + "src": "2863:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 128, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2863:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 131, + "indexed": false, + "mutability": "mutable", + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 133, + "src": "2881:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 130, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2881:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "2840:55:0" + }, + "src": "2820:76:0" + }, + { + "anonymous": false, + "id": 141, + "name": "DeleteAllowance", + "nodeType": "EventDefinition", + "parameters": { + "id": 140, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 135, + "indexed": true, + "mutability": "mutable", + "name": "safe", + "nodeType": "VariableDeclaration", + "scope": 141, + "src": "2923:20:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 134, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2923:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 137, + "indexed": false, + "mutability": "mutable", + "name": "delegate", + "nodeType": "VariableDeclaration", + "scope": 141, + "src": "2945:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 136, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2945:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 139, + "indexed": false, + "mutability": "mutable", + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 141, + "src": "2963:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 138, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2963:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "2922:55:0" + }, + "src": "2901:77:0" + }, + { + "body": { + "id": 289, + "nodeType": "Block", + "src": "3570:1250:0", + "statements": [ + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 161, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 156, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 144, + "src": "3588:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "arguments": [ + { + "hexValue": "30", + "id": 159, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3608:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 158, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "3600:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 157, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3600:7:0", + "typeDescriptions": {} + } + }, + "id": 160, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3600:10:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "src": "3588:22:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "hexValue": "64656c656761746520213d2061646472657373283029", + "id": 162, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3612:24:0", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_47a766b6b1495cbb254fe5e4828ba3622b8f5a171138d82c6bfaf22ff04f26eb", + "typeString": "literal_string \"delegate != address(0)\"" + }, + "value": "delegate != address(0)" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_47a766b6b1495cbb254fe5e4828ba3622b8f5a171138d82c6bfaf22ff04f26eb", + "typeString": "literal_string \"delegate != address(0)\"" + } + ], + "id": 155, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "3580:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 163, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3580:57:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 164, + "nodeType": "ExpressionStatement", + "src": "3580:57:0" + }, + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 177, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "baseExpression": { + "baseExpression": { + "id": 166, + "name": "delegates", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 57, + "src": "3655:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_uint48_$_t_struct$_Delegate_$64_storage_$_$", + "typeString": "mapping(address => mapping(uint48 => struct AllowanceModule.Delegate storage ref))" + } + }, + "id": 169, + "indexExpression": { + "expression": { + "id": 167, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "3665:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 168, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "3665:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3655:21:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint48_$_t_struct$_Delegate_$64_storage_$", + "typeString": "mapping(uint48 => struct AllowanceModule.Delegate storage ref)" + } + }, + "id": 174, + "indexExpression": { + "arguments": [ + { + "id": 172, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 144, + "src": "3684:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 171, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "3677:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint48_$", + "typeString": "type(uint48)" + }, + "typeName": { + "id": 170, + "name": "uint48", + "nodeType": "ElementaryTypeName", + "src": "3677:6:0", + "typeDescriptions": {} + } + }, + "id": 173, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3677:16:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3655:39:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$64_storage", + "typeString": "struct AllowanceModule.Delegate storage ref" + } + }, + "id": 175, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "delegate", + "nodeType": "MemberAccess", + "referencedDeclaration": 59, + "src": "3655:48:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "id": 176, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 144, + "src": "3707:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "3655:60:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "hexValue": "64656c6567617465735b6d73672e73656e6465725d5b75696e7434382864656c6567617465295d2e64656c6567617465203d3d2064656c6567617465", + "id": 178, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3717:62:0", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_58537fa1960fbebccc117b6218b0af08a9f148039299593ea287e665dd534bb1", + "typeString": "literal_string \"delegates[msg.sender][uint48(delegate)].delegate == delegate\"" + }, + "value": "delegates[msg.sender][uint48(delegate)].delegate == delegate" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_58537fa1960fbebccc117b6218b0af08a9f148039299593ea287e665dd534bb1", + "typeString": "literal_string \"delegates[msg.sender][uint48(delegate)].delegate == delegate\"" + } + ], + "id": 165, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "3647:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 179, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3647:133:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 180, + "nodeType": "ExpressionStatement", + "src": "3647:133:0" + }, + { + "assignments": [ + 182 + ], + "declarations": [ + { + "constant": false, + "id": 182, + "mutability": "mutable", + "name": "allowance", + "nodeType": "VariableDeclaration", + "scope": 289, + "src": "3790:26:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance" + }, + "typeName": { + "id": 181, + "name": "Allowance", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 75, + "src": "3790:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_storage_ptr", + "typeString": "struct AllowanceModule.Allowance" + } + }, + "visibility": "internal" + } + ], + "id": 189, + "initialValue": { + "arguments": [ + { + "expression": { + "id": 184, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "3832:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 185, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "3832:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "id": 186, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 144, + "src": "3844:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 187, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 146, + "src": "3854:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 183, + "name": "getAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 360, + "src": "3819:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_address_$_t_address_$_t_address_$returns$_t_struct$_Allowance_$75_memory_ptr_$", + "typeString": "function (address,address,address) view returns (struct AllowanceModule.Allowance memory)" + } + }, + "id": 188, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3819:41:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "3790:70:0" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + }, + "id": 193, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 190, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 182, + "src": "3874:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 191, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "nonce", + "nodeType": "MemberAccess", + "referencedDeclaration": 74, + "src": "3874:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "30", + "id": 192, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3893:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "3874:20:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 211, + "nodeType": "IfStatement", + "src": "3870:210:0", + "trueBody": { + "id": 210, + "nodeType": "Block", + "src": "3896:184:0", + "statements": [ + { + "expression": { + "id": 198, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 194, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 182, + "src": "3996:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 196, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "nonce", + "nodeType": "MemberAccess", + "referencedDeclaration": 74, + "src": "3996:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "hexValue": "31", + "id": 197, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4014:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "3996:19:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "id": 199, + "nodeType": "ExpressionStatement", + "src": "3996:19:0" + }, + { + "expression": { + "arguments": [ + { + "id": 207, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 146, + "src": "4063:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "expression": { + "baseExpression": { + "baseExpression": { + "id": 200, + "name": "tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 47, + "src": "4029:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_array$_t_address_$dyn_storage_$_$", + "typeString": "mapping(address => mapping(address => address[] storage ref))" + } + }, + "id": 204, + "indexExpression": { + "expression": { + "id": 201, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "4036:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 202, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "4036:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "4029:18:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_array$_t_address_$dyn_storage_$", + "typeString": "mapping(address => address[] storage ref)" + } + }, + "id": 205, + "indexExpression": { + "id": 203, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 144, + "src": "4048:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "4029:28:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 206, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "push", + "nodeType": "MemberAccess", + "src": "4029:33:0", + "typeDescriptions": { + "typeIdentifier": "t_function_arraypush_nonpayable$_t_address_$returns$__$", + "typeString": "function (address)" + } + }, + "id": 208, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4029:40:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 209, + "nodeType": "ExpressionStatement", + "src": "4029:40:0" + } + ] + } + }, + { + "assignments": [ + 213 + ], + "declarations": [ + { + "constant": false, + "id": 213, + "mutability": "mutable", + "name": "currentMin", + "nodeType": "VariableDeclaration", + "scope": 289, + "src": "4206:17:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 212, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "4206:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + } + ], + "id": 221, + "initialValue": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 219, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 216, + "name": "block", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -4, + "src": "4233:5:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_block", + "typeString": "block" + } + }, + "id": 217, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "timestamp", + "nodeType": "MemberAccess", + "src": "4233:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "/", + "rightExpression": { + "hexValue": "3630", + "id": 218, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4251:2:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_60_by_1", + "typeString": "int_const 60" + }, + "value": "60" + }, + "src": "4233:20:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 215, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "4226:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint32_$", + "typeString": "type(uint32)" + }, + "typeName": { + "id": 214, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "4226:6:0", + "typeDescriptions": {} + } + }, + "id": 220, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4226:28:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "4206:48:0" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "id": 224, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 222, + "name": "resetBaseMin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 152, + "src": "4268:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "hexValue": "30", + "id": 223, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4283:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "4268:16:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "condition": { + "commonType": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "id": 250, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 247, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 182, + "src": "4482:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 248, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "lastResetMin", + "nodeType": "MemberAccess", + "referencedDeclaration": 72, + "src": "4482:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "30", + "id": 249, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4508:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "4482:27:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 258, + "nodeType": "IfStatement", + "src": "4478:93:0", + "trueBody": { + "id": 257, + "nodeType": "Block", + "src": "4511:60:0", + "statements": [ + { + "expression": { + "id": 255, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 251, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 182, + "src": "4525:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 253, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "lastResetMin", + "nodeType": "MemberAccess", + "referencedDeclaration": 72, + "src": "4525:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "id": 254, + "name": "currentMin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 213, + "src": "4550:10:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "src": "4525:35:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "id": 256, + "nodeType": "ExpressionStatement", + "src": "4525:35:0" + } + ] + } + }, + "id": 259, + "nodeType": "IfStatement", + "src": "4264:307:0", + "trueBody": { + "id": 246, + "nodeType": "Block", + "src": "4286:186:0", + "statements": [ + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "id": 228, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 226, + "name": "resetBaseMin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 152, + "src": "4308:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "id": 227, + "name": "currentMin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 213, + "src": "4324:10:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "src": "4308:26:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "hexValue": "7265736574426173654d696e203c3d2063757272656e744d696e", + "id": 229, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4336:28:0", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_1ede17760f99a36e22c97a9975aa792b767bce45958763871f51d908d7d840ba", + "typeString": "literal_string \"resetBaseMin <= currentMin\"" + }, + "value": "resetBaseMin <= currentMin" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_1ede17760f99a36e22c97a9975aa792b767bce45958763871f51d908d7d840ba", + "typeString": "literal_string \"resetBaseMin <= currentMin\"" + } + ], + "id": 225, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "4300:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 230, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4300:65:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 231, + "nodeType": "ExpressionStatement", + "src": "4300:65:0" + }, + { + "expression": { + "id": 244, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 232, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 182, + "src": "4379:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 234, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "lastResetMin", + "nodeType": "MemberAccess", + "referencedDeclaration": 72, + "src": "4379:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "commonType": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "id": 243, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 235, + "name": "currentMin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 213, + "src": "4404:10:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "id": 241, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "id": 238, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 236, + "name": "currentMin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 213, + "src": "4419:10:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "id": 237, + "name": "resetBaseMin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 152, + "src": "4432:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "src": "4419:25:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + } + ], + "id": 239, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "4418:27:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "BinaryOperation", + "operator": "%", + "rightExpression": { + "id": 240, + "name": "resetTimeMin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 150, + "src": "4448:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "src": "4418:42:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + } + ], + "id": 242, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "4417:44:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "src": "4404:57:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "src": "4379:82:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "id": 245, + "nodeType": "ExpressionStatement", + "src": "4379:82:0" + } + ] + } + }, + { + "expression": { + "id": 264, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 260, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 182, + "src": "4580:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 262, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "resetTimeMin", + "nodeType": "MemberAccess", + "referencedDeclaration": 70, + "src": "4580:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "id": 263, + "name": "resetTimeMin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 150, + "src": "4605:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "src": "4580:37:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "id": 265, + "nodeType": "ExpressionStatement", + "src": "4580:37:0" + }, + { + "expression": { + "id": 270, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 266, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 182, + "src": "4627:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 268, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "amount", + "nodeType": "MemberAccess", + "referencedDeclaration": 66, + "src": "4627:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "id": 269, + "name": "allowanceAmount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 148, + "src": "4646:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "src": "4627:34:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "id": 271, + "nodeType": "ExpressionStatement", + "src": "4627:34:0" + }, + { + "expression": { + "arguments": [ + { + "expression": { + "id": 273, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "4687:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 274, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "4687:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "id": 275, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 144, + "src": "4699:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 276, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 146, + "src": "4709:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 277, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 182, + "src": "4716:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + ], + "id": 272, + "name": "updateAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 382, + "src": "4671:15:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_address_$_t_struct$_Allowance_$75_memory_ptr_$returns$__$", + "typeString": "function (address,address,address,struct AllowanceModule.Allowance memory)" + } + }, + "id": 278, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4671:55:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 279, + "nodeType": "ExpressionStatement", + "src": "4671:55:0" + }, + { + "eventCall": { + "arguments": [ + { + "expression": { + "id": 281, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "4754:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 282, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "4754:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "id": 283, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 144, + "src": "4766:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 284, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 146, + "src": "4776:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 285, + "name": "allowanceAmount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 148, + "src": "4783:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + { + "id": 286, + "name": "resetTimeMin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 150, + "src": "4800:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + ], + "id": 280, + "name": "SetAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 125, + "src": "4741:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_address_$_t_uint96_$_t_uint16_$returns$__$", + "typeString": "function (address,address,address,uint96,uint16)" + } + }, + "id": 287, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4741:72:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 288, + "nodeType": "EmitStatement", + "src": "4736:77:0" + } + ] + }, + "documentation": { + "id": 142, + "nodeType": "StructuredDocumentation", + "src": "2984:441:0", + "text": "@dev Allows to update the allowance for a specified token. This can only be done via a Safe transaction.\n @param delegate Delegate whose allowance should be updated.\n @param token Token contract address.\n @param allowanceAmount allowance in smallest token unit.\n @param resetTimeMin Time after which the allowance should reset\n @param resetBaseMin Time based on which the reset time should be increased" + }, + "functionSelector": "beaeb388", + "id": 290, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "setAllowance", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 153, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 144, + "mutability": "mutable", + "name": "delegate", + "nodeType": "VariableDeclaration", + "scope": 290, + "src": "3452:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 143, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3452:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 146, + "mutability": "mutable", + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 290, + "src": "3470:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 145, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3470:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 148, + "mutability": "mutable", + "name": "allowanceAmount", + "nodeType": "VariableDeclaration", + "scope": 290, + "src": "3485:22:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "typeName": { + "id": 147, + "name": "uint96", + "nodeType": "ElementaryTypeName", + "src": "3485:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 150, + "mutability": "mutable", + "name": "resetTimeMin", + "nodeType": "VariableDeclaration", + "scope": 290, + "src": "3509:19:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + }, + "typeName": { + "id": 149, + "name": "uint16", + "nodeType": "ElementaryTypeName", + "src": "3509:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 152, + "mutability": "mutable", + "name": "resetBaseMin", + "nodeType": "VariableDeclaration", + "scope": 290, + "src": "3530:19:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 151, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "3530:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + } + ], + "src": "3451:99:0" + }, + "returnParameters": { + "id": 154, + "nodeType": "ParameterList", + "parameters": [], + "src": "3570:0:0" + }, + "scope": 1428, + "src": "3430:1390:0", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "public" + }, + { + "body": { + "id": 359, + "nodeType": "Block", + "src": "4945:667:0", + "statements": [ + { + "expression": { + "id": 309, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 301, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 299, + "src": "4955:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "baseExpression": { + "baseExpression": { + "baseExpression": { + "id": 302, + "name": "allowances", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 40, + "src": "4967:10:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_mapping$_t_address_$_t_struct$_Allowance_$75_storage_$_$_$", + "typeString": "mapping(address => mapping(address => mapping(address => struct AllowanceModule.Allowance storage ref)))" + } + }, + "id": 304, + "indexExpression": { + "id": 303, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 292, + "src": "4978:4:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "4967:16:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_struct$_Allowance_$75_storage_$_$", + "typeString": "mapping(address => mapping(address => struct AllowanceModule.Allowance storage ref))" + } + }, + "id": 306, + "indexExpression": { + "id": 305, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 294, + "src": "4984:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "4967:26:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Allowance_$75_storage_$", + "typeString": "mapping(address => struct AllowanceModule.Allowance storage ref)" + } + }, + "id": 308, + "indexExpression": { + "id": 307, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 296, + "src": "4994:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "4967:33:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_storage", + "typeString": "struct AllowanceModule.Allowance storage ref" + } + }, + "src": "4955:45:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 310, + "nodeType": "ExpressionStatement", + "src": "4955:45:0" + }, + { + "assignments": [ + 312 + ], + "declarations": [ + { + "constant": false, + "id": 312, + "mutability": "mutable", + "name": "currentMin", + "nodeType": "VariableDeclaration", + "scope": 359, + "src": "5072:17:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 311, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "5072:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + } + ], + "id": 320, + "initialValue": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 318, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 315, + "name": "block", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -4, + "src": "5099:5:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_block", + "typeString": "block" + } + }, + "id": 316, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "timestamp", + "nodeType": "MemberAccess", + "src": "5099:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "/", + "rightExpression": { + "hexValue": "3630", + "id": 317, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "5117:2:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_60_by_1", + "typeString": "int_const 60" + }, + "value": "60" + }, + "src": "5099:20:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 314, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "5092:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint32_$", + "typeString": "type(uint32)" + }, + "typeName": { + "id": 313, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "5092:6:0", + "typeDescriptions": {} + } + }, + "id": 319, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5092:28:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "5072:48:0" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 332, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "commonType": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + }, + "id": 324, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 321, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 299, + "src": "5232:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 322, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "resetTimeMin", + "nodeType": "MemberAccess", + "referencedDeclaration": 70, + "src": "5232:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "hexValue": "30", + "id": 323, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "5257:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "5232:26:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "&&", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "id": 331, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 325, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 299, + "src": "5262:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 326, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "lastResetMin", + "nodeType": "MemberAccess", + "referencedDeclaration": 72, + "src": "5262:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "id": 330, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 327, + "name": "currentMin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 312, + "src": "5288:10:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "expression": { + "id": 328, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 299, + "src": "5301:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 329, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "resetTimeMin", + "nodeType": "MemberAccess", + "referencedDeclaration": 70, + "src": "5301:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "src": "5288:35:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "src": "5262:61:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "5232:91:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 356, + "nodeType": "IfStatement", + "src": "5228:352:0", + "trueBody": { + "id": 355, + "nodeType": "Block", + "src": "5325:255:0", + "statements": [ + { + "expression": { + "id": 337, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 333, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 299, + "src": "5339:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 335, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "spent", + "nodeType": "MemberAccess", + "referencedDeclaration": 68, + "src": "5339:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "hexValue": "30", + "id": 336, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "5357:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "5339:19:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "id": 338, + "nodeType": "ExpressionStatement", + "src": "5339:19:0" + }, + { + "expression": { + "id": 353, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 339, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 299, + "src": "5467:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 341, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "lastResetMin", + "nodeType": "MemberAccess", + "referencedDeclaration": 72, + "src": "5467:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "commonType": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "id": 352, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 342, + "name": "currentMin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 312, + "src": "5492:10:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "id": 350, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "id": 346, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 343, + "name": "currentMin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 312, + "src": "5507:10:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "expression": { + "id": 344, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 299, + "src": "5520:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 345, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "lastResetMin", + "nodeType": "MemberAccess", + "referencedDeclaration": 72, + "src": "5520:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "src": "5507:35:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + } + ], + "id": 347, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "5506:37:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "BinaryOperation", + "operator": "%", + "rightExpression": { + "expression": { + "id": 348, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 299, + "src": "5546:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 349, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "resetTimeMin", + "nodeType": "MemberAccess", + "referencedDeclaration": 70, + "src": "5546:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "src": "5506:62:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + } + ], + "id": 351, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "5505:64:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "src": "5492:77:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "src": "5467:102:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "id": 354, + "nodeType": "ExpressionStatement", + "src": "5467:102:0" + } + ] + } + }, + { + "expression": { + "id": 357, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 299, + "src": "5596:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "functionReturnParameters": 300, + "id": 358, + "nodeType": "Return", + "src": "5589:16:0" + } + ] + }, + "id": 360, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getAllowance", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 297, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 292, + "mutability": "mutable", + "name": "safe", + "nodeType": "VariableDeclaration", + "scope": 360, + "src": "4848:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 291, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4848:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 294, + "mutability": "mutable", + "name": "delegate", + "nodeType": "VariableDeclaration", + "scope": 360, + "src": "4862:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 293, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4862:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 296, + "mutability": "mutable", + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 360, + "src": "4880:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 295, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4880:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "4847:47:0" + }, + "returnParameters": { + "id": 300, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 299, + "mutability": "mutable", + "name": "allowance", + "nodeType": "VariableDeclaration", + "scope": 360, + "src": "4917:26:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance" + }, + "typeName": { + "id": 298, + "name": "Allowance", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 75, + "src": "4917:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_storage_ptr", + "typeString": "struct AllowanceModule.Allowance" + } + }, + "visibility": "internal" + } + ], + "src": "4916:28:0" + }, + "scope": 1428, + "src": "4826:786:0", + "stateMutability": "view", + "virtual": false, + "visibility": "private" + }, + { + "body": { + "id": 381, + "nodeType": "Block", + "src": "5726:62:0", + "statements": [ + { + "expression": { + "id": 379, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "baseExpression": { + "baseExpression": { + "baseExpression": { + "id": 371, + "name": "allowances", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 40, + "src": "5736:10:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_mapping$_t_address_$_t_struct$_Allowance_$75_storage_$_$_$", + "typeString": "mapping(address => mapping(address => mapping(address => struct AllowanceModule.Allowance storage ref)))" + } + }, + "id": 375, + "indexExpression": { + "id": 372, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 362, + "src": "5747:4:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "5736:16:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_struct$_Allowance_$75_storage_$_$", + "typeString": "mapping(address => mapping(address => struct AllowanceModule.Allowance storage ref))" + } + }, + "id": 376, + "indexExpression": { + "id": 373, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 364, + "src": "5753:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "5736:26:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Allowance_$75_storage_$", + "typeString": "mapping(address => struct AllowanceModule.Allowance storage ref)" + } + }, + "id": 377, + "indexExpression": { + "id": 374, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 366, + "src": "5763:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "5736:33:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_storage", + "typeString": "struct AllowanceModule.Allowance storage ref" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "id": 378, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 368, + "src": "5772:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "src": "5736:45:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_storage", + "typeString": "struct AllowanceModule.Allowance storage ref" + } + }, + "id": 380, + "nodeType": "ExpressionStatement", + "src": "5736:45:0" + } + ] + }, + "id": 382, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "updateAllowance", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 369, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 362, + "mutability": "mutable", + "name": "safe", + "nodeType": "VariableDeclaration", + "scope": 382, + "src": "5643:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 361, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5643:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 364, + "mutability": "mutable", + "name": "delegate", + "nodeType": "VariableDeclaration", + "scope": 382, + "src": "5657:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 363, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5657:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 366, + "mutability": "mutable", + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 382, + "src": "5675:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 365, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5675:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 368, + "mutability": "mutable", + "name": "allowance", + "nodeType": "VariableDeclaration", + "scope": 382, + "src": "5690:26:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance" + }, + "typeName": { + "id": 367, + "name": "Allowance", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 75, + "src": "5690:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_storage_ptr", + "typeString": "struct AllowanceModule.Allowance" + } + }, + "visibility": "internal" + } + ], + "src": "5642:75:0" + }, + "returnParameters": { + "id": 370, + "nodeType": "ParameterList", + "parameters": [], + "src": "5726:0:0" + }, + "scope": 1428, + "src": "5618:170:0", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "private" + }, + { + "body": { + "id": 420, + "nodeType": "Block", + "src": "6049:239:0", + "statements": [ + { + "assignments": [ + 391 + ], + "declarations": [ + { + "constant": false, + "id": 391, + "mutability": "mutable", + "name": "allowance", + "nodeType": "VariableDeclaration", + "scope": 420, + "src": "6059:26:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance" + }, + "typeName": { + "id": 390, + "name": "Allowance", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 75, + "src": "6059:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_storage_ptr", + "typeString": "struct AllowanceModule.Allowance" + } + }, + "visibility": "internal" + } + ], + "id": 398, + "initialValue": { + "arguments": [ + { + "expression": { + "id": 393, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "6101:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 394, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "6101:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "id": 395, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 385, + "src": "6113:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 396, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 387, + "src": "6123:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 392, + "name": "getAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 360, + "src": "6088:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_address_$_t_address_$_t_address_$returns$_t_struct$_Allowance_$75_memory_ptr_$", + "typeString": "function (address,address,address) view returns (struct AllowanceModule.Allowance memory)" + } + }, + "id": 397, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6088:41:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "6059:70:0" + }, + { + "expression": { + "id": 403, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 399, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 391, + "src": "6139:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 401, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "spent", + "nodeType": "MemberAccess", + "referencedDeclaration": 68, + "src": "6139:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "hexValue": "30", + "id": 402, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6157:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "6139:19:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "id": 404, + "nodeType": "ExpressionStatement", + "src": "6139:19:0" + }, + { + "expression": { + "arguments": [ + { + "expression": { + "id": 406, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "6184:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 407, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "6184:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "id": 408, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 385, + "src": "6196:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 409, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 387, + "src": "6206:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 410, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 391, + "src": "6213:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + ], + "id": 405, + "name": "updateAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 382, + "src": "6168:15:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_address_$_t_struct$_Allowance_$75_memory_ptr_$returns$__$", + "typeString": "function (address,address,address,struct AllowanceModule.Allowance memory)" + } + }, + "id": 411, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6168:55:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 412, + "nodeType": "ExpressionStatement", + "src": "6168:55:0" + }, + { + "eventCall": { + "arguments": [ + { + "expression": { + "id": 414, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "6253:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 415, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "6253:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "id": 416, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 385, + "src": "6265:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 417, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 387, + "src": "6275:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 413, + "name": "ResetAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 133, + "src": "6238:14:0", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_address_$returns$__$", + "typeString": "function (address,address,address)" + } + }, + "id": 418, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6238:43:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 419, + "nodeType": "EmitStatement", + "src": "6233:48:0" + } + ] + }, + "documentation": { + "id": 383, + "nodeType": "StructuredDocumentation", + "src": "5794:186:0", + "text": "@dev Allows to reset the allowance for a specific delegate and token.\n @param delegate Delegate whose allowance should be updated.\n @param token Token contract address." + }, + "functionSelector": "c19bf50e", + "id": 421, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "resetAllowance", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 388, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 385, + "mutability": "mutable", + "name": "delegate", + "nodeType": "VariableDeclaration", + "scope": 421, + "src": "6009:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 384, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6009:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 387, + "mutability": "mutable", + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 421, + "src": "6027:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 386, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6027:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "6008:33:0" + }, + "returnParameters": { + "id": 389, + "nodeType": "ParameterList", + "parameters": [], + "src": "6049:0:0" + }, + "scope": 1428, + "src": "5985:303:0", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "public" + }, + { + "body": { + "id": 477, + "nodeType": "Block", + "src": "6613:342:0", + "statements": [ + { + "assignments": [ + 430 + ], + "declarations": [ + { + "constant": false, + "id": 430, + "mutability": "mutable", + "name": "allowance", + "nodeType": "VariableDeclaration", + "scope": 477, + "src": "6623:26:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance" + }, + "typeName": { + "id": 429, + "name": "Allowance", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 75, + "src": "6623:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_storage_ptr", + "typeString": "struct AllowanceModule.Allowance" + } + }, + "visibility": "internal" + } + ], + "id": 437, + "initialValue": { + "arguments": [ + { + "expression": { + "id": 432, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "6665:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 433, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "6665:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "id": 434, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 424, + "src": "6677:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 435, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 426, + "src": "6687:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 431, + "name": "getAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 360, + "src": "6652:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_address_$_t_address_$_t_address_$returns$_t_struct$_Allowance_$75_memory_ptr_$", + "typeString": "function (address,address,address) view returns (struct AllowanceModule.Allowance memory)" + } + }, + "id": 436, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6652:41:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "6623:70:0" + }, + { + "expression": { + "id": 442, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 438, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 430, + "src": "6703:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 440, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "amount", + "nodeType": "MemberAccess", + "referencedDeclaration": 66, + "src": "6703:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "hexValue": "30", + "id": 441, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6722:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "6703:20:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "id": 443, + "nodeType": "ExpressionStatement", + "src": "6703:20:0" + }, + { + "expression": { + "id": 448, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 444, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 430, + "src": "6733:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 446, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "spent", + "nodeType": "MemberAccess", + "referencedDeclaration": 68, + "src": "6733:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "hexValue": "30", + "id": 447, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6751:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "6733:19:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "id": 449, + "nodeType": "ExpressionStatement", + "src": "6733:19:0" + }, + { + "expression": { + "id": 454, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 450, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 430, + "src": "6762:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 452, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "resetTimeMin", + "nodeType": "MemberAccess", + "referencedDeclaration": 70, + "src": "6762:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "hexValue": "30", + "id": 453, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6787:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "6762:26:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "id": 455, + "nodeType": "ExpressionStatement", + "src": "6762:26:0" + }, + { + "expression": { + "id": 460, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 456, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 430, + "src": "6798:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 458, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "lastResetMin", + "nodeType": "MemberAccess", + "referencedDeclaration": 72, + "src": "6798:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "hexValue": "30", + "id": 459, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6823:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "6798:26:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "id": 461, + "nodeType": "ExpressionStatement", + "src": "6798:26:0" + }, + { + "expression": { + "arguments": [ + { + "expression": { + "id": 463, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "6850:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 464, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "6850:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "id": 465, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 424, + "src": "6862:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 466, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 426, + "src": "6872:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 467, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 430, + "src": "6879:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + ], + "id": 462, + "name": "updateAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 382, + "src": "6834:15:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_address_$_t_struct$_Allowance_$75_memory_ptr_$returns$__$", + "typeString": "function (address,address,address,struct AllowanceModule.Allowance memory)" + } + }, + "id": 468, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6834:55:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 469, + "nodeType": "ExpressionStatement", + "src": "6834:55:0" + }, + { + "eventCall": { + "arguments": [ + { + "expression": { + "id": 471, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "6920:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 472, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "6920:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "id": 473, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 424, + "src": "6932:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 474, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 426, + "src": "6942:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 470, + "name": "DeleteAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 141, + "src": "6904:15:0", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_address_$returns$__$", + "typeString": "function (address,address,address)" + } + }, + "id": 475, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6904:44:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 476, + "nodeType": "EmitStatement", + "src": "6899:49:0" + } + ] + }, + "documentation": { + "id": 422, + "nodeType": "StructuredDocumentation", + "src": "6294:237:0", + "text": "@dev Allows to remove the allowance for a specific delegate and token. This will set all values except the `nonce` to 0.\n @param delegate Delegate whose allowance should be updated.\n @param token Token contract address." + }, + "functionSelector": "885133e3", + "id": 478, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "deleteAllowance", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 427, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 424, + "mutability": "mutable", + "name": "delegate", + "nodeType": "VariableDeclaration", + "scope": 478, + "src": "6561:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 423, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6561:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 426, + "mutability": "mutable", + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 478, + "src": "6579:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 425, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6579:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "6560:33:0" + }, + "returnParameters": { + "id": 428, + "nodeType": "ParameterList", + "parameters": [], + "src": "6613:0:0" + }, + "scope": 1428, + "src": "6536:419:0", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "public" + }, + { + "body": { + "id": 685, + "nodeType": "Block", + "src": "7828:2095:0", + "statements": [ + { + "assignments": [ + 499 + ], + "declarations": [ + { + "constant": false, + "id": 499, + "mutability": "mutable", + "name": "allowance", + "nodeType": "VariableDeclaration", + "scope": 685, + "src": "7867:26:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance" + }, + "typeName": { + "id": 498, + "name": "Allowance", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 75, + "src": "7867:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_storage_ptr", + "typeString": "struct AllowanceModule.Allowance" + } + }, + "visibility": "internal" + } + ], + "id": 508, + "initialValue": { + "arguments": [ + { + "arguments": [ + { + "id": 503, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 481, + "src": "7917:4:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + ], + "id": 502, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "7909:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 501, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "7909:7:0", + "typeDescriptions": {} + } + }, + "id": 504, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7909:13:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 505, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 493, + "src": "7924:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 506, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 483, + "src": "7934:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 500, + "name": "getAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 360, + "src": "7896:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_address_$_t_address_$_t_address_$returns$_t_struct$_Allowance_$75_memory_ptr_$", + "typeString": "function (address,address,address) view returns (struct AllowanceModule.Allowance memory)" + } + }, + "id": 507, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7896:44:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "7867:73:0" + }, + { + "assignments": [ + 510 + ], + "declarations": [ + { + "constant": false, + "id": 510, + "mutability": "mutable", + "name": "transferHashData", + "nodeType": "VariableDeclaration", + "scope": 685, + "src": "7950:29:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 509, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "7950:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "id": 524, + "initialValue": { + "arguments": [ + { + "arguments": [ + { + "id": 514, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 481, + "src": "8015:4:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + ], + "id": 513, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "8007:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 512, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "8007:7:0", + "typeDescriptions": {} + } + }, + "id": 515, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8007:13:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 516, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 483, + "src": "8022:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 517, + "name": "to", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 485, + "src": "8029:2:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "id": 518, + "name": "amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 487, + "src": "8033:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + { + "id": 519, + "name": "paymentToken", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 489, + "src": "8041:12:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 520, + "name": "payment", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 491, + "src": "8055:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + { + "expression": { + "id": 521, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 499, + "src": "8064:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 522, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "nonce", + "nodeType": "MemberAccess", + "referencedDeclaration": 74, + "src": "8064:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + ], + "id": 511, + "name": "generateTransferHashData", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 766, + "src": "7982:24:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_address_$_t_address_$_t_address_$_t_uint96_$_t_address_$_t_uint96_$_t_uint16_$returns$_t_bytes_memory_ptr_$", + "typeString": "function (address,address,address,uint96,address,uint96,uint16) view returns (bytes memory)" + } + }, + "id": 523, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7982:98:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "7950:130:0" + }, + { + "expression": { + "id": 532, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 525, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 499, + "src": "8115:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 527, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "nonce", + "nodeType": "MemberAccess", + "referencedDeclaration": 74, + "src": "8115:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "commonType": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + }, + "id": 531, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 528, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 499, + "src": "8133:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 529, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "nonce", + "nodeType": "MemberAccess", + "referencedDeclaration": 74, + "src": "8133:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "hexValue": "31", + "id": 530, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8151:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "8133:19:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "src": "8115:37:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "id": 533, + "nodeType": "ExpressionStatement", + "src": "8115:37:0" + }, + { + "assignments": [ + 535 + ], + "declarations": [ + { + "constant": false, + "id": 535, + "mutability": "mutable", + "name": "newSpent", + "nodeType": "VariableDeclaration", + "scope": 685, + "src": "8162:15:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "typeName": { + "id": 534, + "name": "uint96", + "nodeType": "ElementaryTypeName", + "src": "8162:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "visibility": "internal" + } + ], + "id": 540, + "initialValue": { + "commonType": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "id": 539, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 536, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 499, + "src": "8180:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 537, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "spent", + "nodeType": "MemberAccess", + "referencedDeclaration": 68, + "src": "8180:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "id": 538, + "name": "amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 487, + "src": "8198:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "src": "8180:24:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "8162:42:0" + }, + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 550, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "commonType": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "id": 545, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 542, + "name": "newSpent", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 535, + "src": "8269:8:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "expression": { + "id": 543, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 499, + "src": "8280:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 544, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "spent", + "nodeType": "MemberAccess", + "referencedDeclaration": 68, + "src": "8280:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "src": "8269:26:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "&&", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "id": 549, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 546, + "name": "newSpent", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 535, + "src": "8299:8:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "expression": { + "id": 547, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 499, + "src": "8311:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 548, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "amount", + "nodeType": "MemberAccess", + "referencedDeclaration": 66, + "src": "8311:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "src": "8299:28:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "8269:58:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "hexValue": "6e65775370656e74203e20616c6c6f77616e63652e7370656e74202626206e65775370656e74203c3d20616c6c6f77616e63652e616d6f756e74", + "id": 551, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8329:60:0", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_a7359a8519961096cf8fb65715f77dbc4de2755aabf21e3445e245a34ee622da", + "typeString": "literal_string \"newSpent > allowance.spent && newSpent <= allowance.amount\"" + }, + "value": "newSpent > allowance.spent && newSpent <= allowance.amount" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_a7359a8519961096cf8fb65715f77dbc4de2755aabf21e3445e245a34ee622da", + "typeString": "literal_string \"newSpent > allowance.spent && newSpent <= allowance.amount\"" + } + ], + "id": 541, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "8261:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 552, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8261:129:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 553, + "nodeType": "ExpressionStatement", + "src": "8261:129:0" + }, + { + "expression": { + "id": 558, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 554, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 499, + "src": "8400:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 556, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "spent", + "nodeType": "MemberAccess", + "referencedDeclaration": 68, + "src": "8400:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "id": 557, + "name": "newSpent", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 535, + "src": "8418:8:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "src": "8400:26:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "id": 559, + "nodeType": "ExpressionStatement", + "src": "8400:26:0" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "id": 562, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 560, + "name": "payment", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 491, + "src": "8440:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "hexValue": "30", + "id": 561, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8450:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "8440:11:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 620, + "nodeType": "IfStatement", + "src": "8436:748:0", + "trueBody": { + "id": 619, + "nodeType": "Block", + "src": "8453:731:0", + "statements": [ + { + "assignments": [ + 564 + ], + "declarations": [ + { + "constant": false, + "id": 564, + "mutability": "mutable", + "name": "paymentAllowance", + "nodeType": "VariableDeclaration", + "scope": 619, + "src": "8543:33:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance" + }, + "typeName": { + "id": 563, + "name": "Allowance", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 75, + "src": "8543:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_storage_ptr", + "typeString": "struct AllowanceModule.Allowance" + } + }, + "visibility": "internal" + } + ], + "id": 578, + "initialValue": { + "condition": { + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 567, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 565, + "name": "paymentToken", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 489, + "src": "8579:12:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "id": 566, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 483, + "src": "8595:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "8579:21:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseExpression": { + "arguments": [ + { + "arguments": [ + { + "id": 572, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 481, + "src": "8636:4:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + ], + "id": 571, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "8628:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 570, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "8628:7:0", + "typeDescriptions": {} + } + }, + "id": 573, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8628:13:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 574, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 493, + "src": "8643:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 575, + "name": "paymentToken", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 489, + "src": "8653:12:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 569, + "name": "getAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 360, + "src": "8615:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_address_$_t_address_$_t_address_$returns$_t_struct$_Allowance_$75_memory_ptr_$", + "typeString": "function (address,address,address) view returns (struct AllowanceModule.Allowance memory)" + } + }, + "id": 576, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8615:51:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 577, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "Conditional", + "src": "8579:87:0", + "trueExpression": { + "id": 568, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 499, + "src": "8603:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "8543:123:0" + }, + { + "expression": { + "id": 584, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 579, + "name": "newSpent", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 535, + "src": "8680:8:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "commonType": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "id": 583, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 580, + "name": "paymentAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 564, + "src": "8691:16:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 581, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "spent", + "nodeType": "MemberAccess", + "referencedDeclaration": 68, + "src": "8691:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "id": 582, + "name": "payment", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 491, + "src": "8716:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "src": "8691:32:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "src": "8680:43:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "id": 585, + "nodeType": "ExpressionStatement", + "src": "8680:43:0" + }, + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 595, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "commonType": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "id": 590, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 587, + "name": "newSpent", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 535, + "src": "8796:8:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "expression": { + "id": 588, + "name": "paymentAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 564, + "src": "8807:16:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 589, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "spent", + "nodeType": "MemberAccess", + "referencedDeclaration": 68, + "src": "8807:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "src": "8796:33:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "&&", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "id": 594, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 591, + "name": "newSpent", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 535, + "src": "8833:8:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "expression": { + "id": 592, + "name": "paymentAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 564, + "src": "8845:16:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 593, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "amount", + "nodeType": "MemberAccess", + "referencedDeclaration": 66, + "src": "8845:23:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "src": "8833:35:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "8796:72:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "hexValue": "6e65775370656e74203e207061796d656e74416c6c6f77616e63652e7370656e74202626206e65775370656e74203c3d207061796d656e74416c6c6f77616e63652e616d6f756e74", + "id": 596, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8870:74:0", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_b549d52c5706645679000944ae1bcaec935d0b8c387f4240a09789be7dc8c0d4", + "typeString": "literal_string \"newSpent > paymentAllowance.spent && newSpent <= paymentAllowance.amount\"" + }, + "value": "newSpent > paymentAllowance.spent && newSpent <= paymentAllowance.amount" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_b549d52c5706645679000944ae1bcaec935d0b8c387f4240a09789be7dc8c0d4", + "typeString": "literal_string \"newSpent > paymentAllowance.spent && newSpent <= paymentAllowance.amount\"" + } + ], + "id": 586, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "8788:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 597, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8788:157:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 598, + "nodeType": "ExpressionStatement", + "src": "8788:157:0" + }, + { + "expression": { + "id": 603, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 599, + "name": "paymentAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 564, + "src": "8959:16:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 601, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "spent", + "nodeType": "MemberAccess", + "referencedDeclaration": 68, + "src": "8959:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "id": 602, + "name": "newSpent", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 535, + "src": "8984:8:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "src": "8959:33:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "id": 604, + "nodeType": "ExpressionStatement", + "src": "8959:33:0" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 607, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 605, + "name": "paymentToken", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 489, + "src": "9078:12:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "id": 606, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 483, + "src": "9094:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "9078:21:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 618, + "nodeType": "IfStatement", + "src": "9074:99:0", + "trueBody": { + "expression": { + "arguments": [ + { + "arguments": [ + { + "id": 611, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 481, + "src": "9125:4:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + ], + "id": 610, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "9117:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 609, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "9117:7:0", + "typeDescriptions": {} + } + }, + "id": 612, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9117:13:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 613, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 493, + "src": "9132:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 614, + "name": "paymentToken", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 489, + "src": "9142:12:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 615, + "name": "paymentAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 564, + "src": "9156:16:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + ], + "id": 608, + "name": "updateAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 382, + "src": "9101:15:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_address_$_t_struct$_Allowance_$75_memory_ptr_$returns$__$", + "typeString": "function (address,address,address,struct AllowanceModule.Allowance memory)" + } + }, + "id": 616, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9101:72:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 617, + "nodeType": "ExpressionStatement", + "src": "9101:72:0" + } + } + ] + } + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "id": 624, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 481, + "src": "9217:4:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + ], + "id": 623, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "9209:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 622, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "9209:7:0", + "typeDescriptions": {} + } + }, + "id": 625, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9209:13:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 626, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 493, + "src": "9224:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 627, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 483, + "src": "9234:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 628, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 499, + "src": "9241:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + ], + "id": 621, + "name": "updateAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 382, + "src": "9193:15:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_address_$_t_struct$_Allowance_$75_memory_ptr_$returns$__$", + "typeString": "function (address,address,address,struct AllowanceModule.Allowance memory)" + } + }, + "id": 629, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9193:58:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 630, + "nodeType": "ExpressionStatement", + "src": "9193:58:0" + }, + { + "expression": { + "arguments": [ + { + "id": 632, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 493, + "src": "9345:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 633, + "name": "signature", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 495, + "src": "9355:9:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + { + "id": 634, + "name": "transferHashData", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 510, + "src": "9366:16:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + { + "id": 635, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 481, + "src": "9384:4:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + }, + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + }, + { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + ], + "id": 631, + "name": "checkSignature", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 840, + "src": "9330:14:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_address_$_t_bytes_memory_ptr_$_t_bytes_memory_ptr_$_t_contract$_GnosisSafe_$18_$returns$__$", + "typeString": "function (address,bytes memory,bytes memory,contract GnosisSafe) view" + } + }, + "id": 636, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9330:59:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 637, + "nodeType": "ExpressionStatement", + "src": "9330:59:0" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "id": 640, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 638, + "name": "payment", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 491, + "src": "9404:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "hexValue": "30", + "id": 639, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "9414:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "9404:11:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 662, + "nodeType": "IfStatement", + "src": "9400:344:0", + "trueBody": { + "id": 661, + "nodeType": "Block", + "src": "9417:327:0", + "statements": [ + { + "expression": { + "arguments": [ + { + "id": 642, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 481, + "src": "9534:4:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + }, + { + "id": 643, + "name": "paymentToken", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 489, + "src": "9540:12:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "expression": { + "id": 644, + "name": "tx", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -26, + "src": "9554:2:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_transaction", + "typeString": "tx" + } + }, + "id": 645, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "origin", + "nodeType": "MemberAccess", + "src": "9554:9:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "id": 646, + "name": "payment", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 491, + "src": "9565:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + ], + "id": 641, + "name": "transfer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1006, + "src": "9525:8:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_contract$_GnosisSafe_$18_$_t_address_$_t_address_payable_$_t_uint96_$returns$__$", + "typeString": "function (contract GnosisSafe,address,address payable,uint96)" + } + }, + "id": 647, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9525:48:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 648, + "nodeType": "ExpressionStatement", + "src": "9525:48:0" + }, + { + "eventCall": { + "arguments": [ + { + "arguments": [ + { + "id": 652, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 481, + "src": "9683:4:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + ], + "id": 651, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "9675:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 650, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "9675:7:0", + "typeDescriptions": {} + } + }, + "id": 653, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9675:13:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 654, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 493, + "src": "9690:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 655, + "name": "paymentToken", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 489, + "src": "9700:12:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "expression": { + "id": 656, + "name": "tx", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -26, + "src": "9714:2:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_transaction", + "typeString": "tx" + } + }, + "id": 657, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "origin", + "nodeType": "MemberAccess", + "src": "9714:9:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "id": 658, + "name": "payment", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 491, + "src": "9725:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + ], + "id": 649, + "name": "PayAllowanceTransfer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 113, + "src": "9654:20:0", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_address_$_t_address_$_t_uint96_$returns$__$", + "typeString": "function (address,address,address,address,uint96)" + } + }, + "id": 659, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9654:79:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 660, + "nodeType": "EmitStatement", + "src": "9649:84:0" + } + ] + } + }, + { + "expression": { + "arguments": [ + { + "id": 664, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 481, + "src": "9788:4:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + }, + { + "id": 665, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 483, + "src": "9794:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 666, + "name": "to", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 485, + "src": "9801:2:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "id": 667, + "name": "amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 487, + "src": "9805:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + ], + "id": 663, + "name": "transfer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1006, + "src": "9779:8:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_contract$_GnosisSafe_$18_$_t_address_$_t_address_payable_$_t_uint96_$returns$__$", + "typeString": "function (contract GnosisSafe,address,address payable,uint96)" + } + }, + "id": 668, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9779:33:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 669, + "nodeType": "ExpressionStatement", + "src": "9779:33:0" + }, + { + "eventCall": { + "arguments": [ + { + "arguments": [ + { + "id": 673, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 481, + "src": "9860:4:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + ], + "id": 672, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "9852:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 671, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "9852:7:0", + "typeDescriptions": {} + } + }, + "id": 674, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9852:13:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 675, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 493, + "src": "9867:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 676, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 483, + "src": "9877:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 677, + "name": "to", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 485, + "src": "9884:2:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "id": 678, + "name": "amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 487, + "src": "9888:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + { + "commonType": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + }, + "id": 682, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 679, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 499, + "src": "9896:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 680, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "nonce", + "nodeType": "MemberAccess", + "referencedDeclaration": 74, + "src": "9896:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "hexValue": "31", + "id": 681, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "9914:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "9896:19:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + ], + "id": 670, + "name": "ExecuteAllowanceTransfer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 101, + "src": "9827:24:0", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_address_$_t_address_$_t_uint96_$_t_uint16_$returns$__$", + "typeString": "function (address,address,address,address,uint96,uint16)" + } + }, + "id": 683, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9827:89:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 684, + "nodeType": "EmitStatement", + "src": "9822:94:0" + } + ] + }, + "documentation": { + "id": 479, + "nodeType": "StructuredDocumentation", + "src": "6961:604:0", + "text": "@dev Allows to use the allowance to perform a transfer.\n @param safe The Safe whose funds should be used.\n @param token Token contract address.\n @param to Address that should receive the tokens.\n @param amount Amount that should be transferred.\n @param paymentToken Token that should be used to pay for the execution of the transfer.\n @param payment Amount to should be paid for executing the transfer.\n @param delegate Delegate whose allowance should be updated.\n @param signature Signature generated by the delegate to authorize the transfer." + }, + "functionSelector": "4515641a", + "id": 686, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "executeAllowanceTransfer", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 496, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 481, + "mutability": "mutable", + "name": "safe", + "nodeType": "VariableDeclaration", + "scope": 686, + "src": "7613:15:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + }, + "typeName": { + "id": 480, + "name": "GnosisSafe", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 18, + "src": "7613:10:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 483, + "mutability": "mutable", + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 686, + "src": "7638:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 482, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "7638:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 485, + "mutability": "mutable", + "name": "to", + "nodeType": "VariableDeclaration", + "scope": 686, + "src": "7661:18:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + "typeName": { + "id": 484, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "7661:15:0", + "stateMutability": "payable", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 487, + "mutability": "mutable", + "name": "amount", + "nodeType": "VariableDeclaration", + "scope": 686, + "src": "7689:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "typeName": { + "id": 486, + "name": "uint96", + "nodeType": "ElementaryTypeName", + "src": "7689:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 489, + "mutability": "mutable", + "name": "paymentToken", + "nodeType": "VariableDeclaration", + "scope": 686, + "src": "7712:20:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 488, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "7712:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 491, + "mutability": "mutable", + "name": "payment", + "nodeType": "VariableDeclaration", + "scope": 686, + "src": "7742:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "typeName": { + "id": 490, + "name": "uint96", + "nodeType": "ElementaryTypeName", + "src": "7742:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 493, + "mutability": "mutable", + "name": "delegate", + "nodeType": "VariableDeclaration", + "scope": 686, + "src": "7766:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 492, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "7766:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 495, + "mutability": "mutable", + "name": "signature", + "nodeType": "VariableDeclaration", + "scope": 686, + "src": "7792:22:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 494, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "7792:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "src": "7603:217:0" + }, + "returnParameters": { + "id": 497, + "nodeType": "ParameterList", + "parameters": [], + "src": "7828:0:0" + }, + "scope": 1428, + "src": "7570:2353:0", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "public" + }, + { + "body": { + "id": 698, + "nodeType": "Block", + "src": "10038:167:0", + "statements": [ + { + "assignments": [ + 693 + ], + "declarations": [ + { + "constant": false, + "id": 693, + "mutability": "mutable", + "name": "id", + "nodeType": "VariableDeclaration", + "scope": 698, + "src": "10048:10:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 692, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "10048:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 694, + "nodeType": "VariableDeclarationStatement", + "src": "10048:10:0" + }, + { + "AST": { + "nodeType": "YulBlock", + "src": "10141:39:0", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "10155:15:0", + "value": { + "arguments": [], + "functionName": { + "name": "chainid", + "nodeType": "YulIdentifier", + "src": "10161:7:0" + }, + "nodeType": "YulFunctionCall", + "src": "10161:9:0" + }, + "variableNames": [ + { + "name": "id", + "nodeType": "YulIdentifier", + "src": "10155:2:0" + } + ] + } + ] + }, + "evmVersion": "istanbul", + "externalReferences": [ + { + "declaration": 693, + "isOffset": false, + "isSlot": false, + "src": "10155:2:0", + "valueSize": 1 + } + ], + "id": 695, + "nodeType": "InlineAssembly", + "src": "10132:48:0" + }, + { + "expression": { + "id": 696, + "name": "id", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 693, + "src": "10196:2:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 691, + "id": 697, + "nodeType": "Return", + "src": "10189:9:0" + } + ] + }, + "documentation": { + "id": 687, + "nodeType": "StructuredDocumentation", + "src": "9929:52:0", + "text": "@dev Returns the chain id used by this contract." + }, + "functionSelector": "3408e470", + "id": 699, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getChainId", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 688, + "nodeType": "ParameterList", + "parameters": [], + "src": "10005:2:0" + }, + "returnParameters": { + "id": 691, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 690, + "mutability": "mutable", + "name": "", + "nodeType": "VariableDeclaration", + "scope": 699, + "src": "10029:7:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 689, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "10029:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "10028:9:0" + }, + "scope": 1428, + "src": "9986:219:0", + "stateMutability": "pure", + "virtual": false, + "visibility": "public" + }, + { + "body": { + "id": 765, + "nodeType": "Block", + "src": "10528:394:0", + "statements": [ + { + "assignments": [ + 720 + ], + "declarations": [ + { + "constant": false, + "id": 720, + "mutability": "mutable", + "name": "chainId", + "nodeType": "VariableDeclaration", + "scope": 765, + "src": "10538:15:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 719, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "10538:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 723, + "initialValue": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 721, + "name": "getChainId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 699, + "src": "10556:10:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$__$returns$_t_uint256_$", + "typeString": "function () pure returns (uint256)" + } + }, + "id": 722, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10556:12:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "10538:30:0" + }, + { + "assignments": [ + 725 + ], + "declarations": [ + { + "constant": false, + "id": 725, + "mutability": "mutable", + "name": "domainSeparator", + "nodeType": "VariableDeclaration", + "scope": 765, + "src": "10578:23:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 724, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "10578:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "id": 734, + "initialValue": { + "arguments": [ + { + "arguments": [ + { + "id": 729, + "name": "DOMAIN_SEPARATOR_TYPEHASH", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 29, + "src": "10625:25:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "id": 730, + "name": "chainId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 720, + "src": "10652:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 731, + "name": "this", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -28, + "src": "10661:4:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_AllowanceModule_$1428", + "typeString": "contract AllowanceModule" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_contract$_AllowanceModule_$1428", + "typeString": "contract AllowanceModule" + } + ], + "expression": { + "id": 727, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -1, + "src": "10614:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 728, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encode", + "nodeType": "MemberAccess", + "src": "10614:10:0", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencode_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 732, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10614:52:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 726, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -8, + "src": "10604:9:0", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 733, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10604:63:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "10578:89:0" + }, + { + "assignments": [ + 736 + ], + "declarations": [ + { + "constant": false, + "id": 736, + "mutability": "mutable", + "name": "transferHash", + "nodeType": "VariableDeclaration", + "scope": 765, + "src": "10677:20:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 735, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "10677:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "id": 750, + "initialValue": { + "arguments": [ + { + "arguments": [ + { + "id": 740, + "name": "ALLOWANCE_TRANSFER_TYPEHASH", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 32, + "src": "10734:27:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "id": 741, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 702, + "src": "10763:4:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 742, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 704, + "src": "10769:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 743, + "name": "to", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 706, + "src": "10776:2:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 744, + "name": "amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 708, + "src": "10780:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + { + "id": 745, + "name": "paymentToken", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 710, + "src": "10788:12:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 746, + "name": "payment", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 712, + "src": "10802:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + { + "id": 747, + "name": "nonce", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 714, + "src": "10811:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + ], + "expression": { + "id": 738, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -1, + "src": "10723:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 739, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encode", + "nodeType": "MemberAccess", + "src": "10723:10:0", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencode_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 748, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10723:94:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 737, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -8, + "src": "10700:9:0", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 749, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10700:127:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "10677:150:0" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "hexValue": "30783139", + "id": 755, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10866:4:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_25_by_1", + "typeString": "int_const 25" + }, + "value": "0x19" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_25_by_1", + "typeString": "int_const 25" + } + ], + "id": 754, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "10861:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes1_$", + "typeString": "type(bytes1)" + }, + "typeName": { + "id": 753, + "name": "byte", + "nodeType": "ElementaryTypeName", + "src": "10861:4:0", + "typeDescriptions": {} + } + }, + "id": 756, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10861:10:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + { + "arguments": [ + { + "hexValue": "30783031", + "id": 759, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10878:4:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "0x01" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + } + ], + "id": 758, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "10873:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes1_$", + "typeString": "type(bytes1)" + }, + "typeName": { + "id": 757, + "name": "byte", + "nodeType": "ElementaryTypeName", + "src": "10873:4:0", + "typeDescriptions": {} + } + }, + "id": 760, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10873:10:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + { + "id": 761, + "name": "domainSeparator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 725, + "src": "10885:15:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "id": 762, + "name": "transferHash", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 736, + "src": "10902:12:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + }, + { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "expression": { + "id": 751, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -1, + "src": "10844:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 752, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "src": "10844:16:0", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 763, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10844:71:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "functionReturnParameters": 718, + "id": 764, + "nodeType": "Return", + "src": "10837:78:0" + } + ] + }, + "documentation": { + "id": 700, + "nodeType": "StructuredDocumentation", + "src": "10211:72:0", + "text": "@dev Generates the data for the transfer hash (required for signing)" + }, + "id": 766, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "generateTransferHashData", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 715, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 702, + "mutability": "mutable", + "name": "safe", + "nodeType": "VariableDeclaration", + "scope": 766, + "src": "10331:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 701, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "10331:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 704, + "mutability": "mutable", + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 766, + "src": "10353:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 703, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "10353:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 706, + "mutability": "mutable", + "name": "to", + "nodeType": "VariableDeclaration", + "scope": 766, + "src": "10376:10:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 705, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "10376:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 708, + "mutability": "mutable", + "name": "amount", + "nodeType": "VariableDeclaration", + "scope": 766, + "src": "10396:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "typeName": { + "id": 707, + "name": "uint96", + "nodeType": "ElementaryTypeName", + "src": "10396:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 710, + "mutability": "mutable", + "name": "paymentToken", + "nodeType": "VariableDeclaration", + "scope": 766, + "src": "10419:20:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 709, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "10419:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 712, + "mutability": "mutable", + "name": "payment", + "nodeType": "VariableDeclaration", + "scope": 766, + "src": "10449:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "typeName": { + "id": 711, + "name": "uint96", + "nodeType": "ElementaryTypeName", + "src": "10449:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 714, + "mutability": "mutable", + "name": "nonce", + "nodeType": "VariableDeclaration", + "scope": 766, + "src": "10473:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + }, + "typeName": { + "id": 713, + "name": "uint16", + "nodeType": "ElementaryTypeName", + "src": "10473:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "visibility": "internal" + } + ], + "src": "10321:170:0" + }, + "returnParameters": { + "id": 718, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 717, + "mutability": "mutable", + "name": "", + "nodeType": "VariableDeclaration", + "scope": 766, + "src": "10514:12:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 716, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "10514:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "src": "10513:14:0" + }, + "scope": 1428, + "src": "10288:634:0", + "stateMutability": "view", + "virtual": false, + "visibility": "private" + }, + { + "body": { + "id": 798, + "nodeType": "Block", + "src": "11245:136:0", + "statements": [ + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "id": 788, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 769, + "src": "11310:4:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 789, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 771, + "src": "11316:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 790, + "name": "to", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 773, + "src": "11323:2:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 791, + "name": "amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 775, + "src": "11327:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + { + "id": 792, + "name": "paymentToken", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 777, + "src": "11335:12:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 793, + "name": "payment", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 779, + "src": "11349:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + { + "id": 794, + "name": "nonce", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 781, + "src": "11358:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + ], + "id": 787, + "name": "generateTransferHashData", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 766, + "src": "11272:24:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_address_$_t_address_$_t_address_$_t_uint96_$_t_address_$_t_uint96_$_t_uint16_$returns$_t_bytes_memory_ptr_$", + "typeString": "function (address,address,address,uint96,address,uint96,uint16) view returns (bytes memory)" + } + }, + "id": 795, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11272:101:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 786, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -8, + "src": "11262:9:0", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 796, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11262:112:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "functionReturnParameters": 785, + "id": 797, + "nodeType": "Return", + "src": "11255:119:0" + } + ] + }, + "documentation": { + "id": 767, + "nodeType": "StructuredDocumentation", + "src": "10928:82:0", + "text": "@dev Generates the transfer hash that should be signed to authorize a transfer" + }, + "functionSelector": "d626e043", + "id": 799, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "generateTransferHash", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 782, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 769, + "mutability": "mutable", + "name": "safe", + "nodeType": "VariableDeclaration", + "scope": 799, + "src": "11054:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 768, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "11054:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 771, + "mutability": "mutable", + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 799, + "src": "11076:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 770, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "11076:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 773, + "mutability": "mutable", + "name": "to", + "nodeType": "VariableDeclaration", + "scope": 799, + "src": "11099:10:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 772, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "11099:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 775, + "mutability": "mutable", + "name": "amount", + "nodeType": "VariableDeclaration", + "scope": 799, + "src": "11119:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "typeName": { + "id": 774, + "name": "uint96", + "nodeType": "ElementaryTypeName", + "src": "11119:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 777, + "mutability": "mutable", + "name": "paymentToken", + "nodeType": "VariableDeclaration", + "scope": 799, + "src": "11142:20:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 776, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "11142:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 779, + "mutability": "mutable", + "name": "payment", + "nodeType": "VariableDeclaration", + "scope": 799, + "src": "11172:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "typeName": { + "id": 778, + "name": "uint96", + "nodeType": "ElementaryTypeName", + "src": "11172:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 781, + "mutability": "mutable", + "name": "nonce", + "nodeType": "VariableDeclaration", + "scope": 799, + "src": "11196:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + }, + "typeName": { + "id": 780, + "name": "uint16", + "nodeType": "ElementaryTypeName", + "src": "11196:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "visibility": "internal" + } + ], + "src": "11044:170:0" + }, + "returnParameters": { + "id": 785, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 784, + "mutability": "mutable", + "name": "", + "nodeType": "VariableDeclaration", + "scope": 799, + "src": "11236:7:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 783, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "11236:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "11235:9:0" + }, + "scope": 1428, + "src": "11015:366:0", + "stateMutability": "view", + "virtual": false, + "visibility": "public" + }, + { + "body": { + "id": 839, + "nodeType": "Block", + "src": "11522:314:0", + "statements": [ + { + "assignments": [ + 811 + ], + "declarations": [ + { + "constant": false, + "id": 811, + "mutability": "mutable", + "name": "signer", + "nodeType": "VariableDeclaration", + "scope": 839, + "src": "11532:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 810, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "11532:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "id": 816, + "initialValue": { + "arguments": [ + { + "id": 813, + "name": "signature", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 803, + "src": "11566:9:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + { + "id": 814, + "name": "transferHashData", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 805, + "src": "11577:16:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + }, + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 812, + "name": "recoverSignature", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 950, + "src": "11549:16:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_bytes_memory_ptr_$_t_bytes_memory_ptr_$returns$_t_address_$", + "typeString": "function (bytes memory,bytes memory) view returns (address)" + } + }, + "id": 815, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11549:45:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "11532:62:0" + }, + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 835, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 820, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 818, + "name": "expectedDelegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 801, + "src": "11625:16:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "id": 819, + "name": "signer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 811, + "src": "11645:6:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "11625:26:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "&&", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 834, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "baseExpression": { + "baseExpression": { + "id": 821, + "name": "delegates", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 57, + "src": "11655:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_uint48_$_t_struct$_Delegate_$64_storage_$_$", + "typeString": "mapping(address => mapping(uint48 => struct AllowanceModule.Delegate storage ref))" + } + }, + "id": 826, + "indexExpression": { + "arguments": [ + { + "id": 824, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 807, + "src": "11673:4:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + ], + "id": 823, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "11665:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 822, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "11665:7:0", + "typeDescriptions": {} + } + }, + "id": 825, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11665:13:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "11655:24:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint48_$_t_struct$_Delegate_$64_storage_$", + "typeString": "mapping(uint48 => struct AllowanceModule.Delegate storage ref)" + } + }, + "id": 831, + "indexExpression": { + "arguments": [ + { + "id": 829, + "name": "signer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 811, + "src": "11687:6:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 828, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "11680:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint48_$", + "typeString": "type(uint48)" + }, + "typeName": { + "id": 827, + "name": "uint48", + "nodeType": "ElementaryTypeName", + "src": "11680:6:0", + "typeDescriptions": {} + } + }, + "id": 830, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11680:14:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "11655:40:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$64_storage", + "typeString": "struct AllowanceModule.Delegate storage ref" + } + }, + "id": 832, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "delegate", + "nodeType": "MemberAccess", + "referencedDeclaration": 59, + "src": "11655:49:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "id": 833, + "name": "signer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 811, + "src": "11708:6:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "11655:59:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "11625:89:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "hexValue": "657870656374656444656c6567617465203d3d207369676e65722026262064656c6567617465735b616464726573732873616665295d5b75696e743438287369676e6572295d2e64656c6567617465203d3d207369676e6572", + "id": 836, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "11728:91:0", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_967a409fd152609403ac7b3349d7ced54d05d2ee8664844edf017668d343240b", + "typeString": "literal_string \"expectedDelegate == signer && delegates[address(safe)][uint48(signer)].delegate == signer\"" + }, + "value": "expectedDelegate == signer && delegates[address(safe)][uint48(signer)].delegate == signer" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_967a409fd152609403ac7b3349d7ced54d05d2ee8664844edf017668d343240b", + "typeString": "literal_string \"expectedDelegate == signer && delegates[address(safe)][uint48(signer)].delegate == signer\"" + } + ], + "id": 817, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "11604:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 837, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11604:225:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 838, + "nodeType": "ExpressionStatement", + "src": "11604:225:0" + } + ] + }, + "id": 840, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "checkSignature", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 808, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 801, + "mutability": "mutable", + "name": "expectedDelegate", + "nodeType": "VariableDeclaration", + "scope": 840, + "src": "11411:24:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 800, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "11411:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 803, + "mutability": "mutable", + "name": "signature", + "nodeType": "VariableDeclaration", + "scope": 840, + "src": "11437:22:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 802, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "11437:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 805, + "mutability": "mutable", + "name": "transferHashData", + "nodeType": "VariableDeclaration", + "scope": 840, + "src": "11461:29:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 804, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "11461:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 807, + "mutability": "mutable", + "name": "safe", + "nodeType": "VariableDeclaration", + "scope": 840, + "src": "11492:15:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + }, + "typeName": { + "id": 806, + "name": "GnosisSafe", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 18, + "src": "11492:10:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + }, + "visibility": "internal" + } + ], + "src": "11410:98:0" + }, + "returnParameters": { + "id": 809, + "nodeType": "ParameterList", + "parameters": [], + "src": "11522:0:0" + }, + "scope": 1428, + "src": "11387:449:0", + "stateMutability": "view", + "virtual": false, + "visibility": "private" + }, + { + "body": { + "id": 949, + "nodeType": "Block", + "src": "12097:1333:0", + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 852, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 849, + "name": "signature", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 842, + "src": "12178:9:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 850, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "length", + "nodeType": "MemberAccess", + "src": "12178:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "30", + "id": 851, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12198:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "12178:21:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 856, + "nodeType": "IfStatement", + "src": "12174:44:0", + "trueBody": { + "expression": { + "expression": { + "id": 853, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "12208:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 854, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "12208:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "functionReturnParameters": 848, + "id": 855, + "nodeType": "Return", + "src": "12201:17:0" + } + }, + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 861, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 858, + "name": "signature", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 842, + "src": "12326:9:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 859, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "length", + "nodeType": "MemberAccess", + "src": "12326:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "3635", + "id": 860, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12346:2:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_65_by_1", + "typeString": "int_const 65" + }, + "value": "65" + }, + "src": "12326:22:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "hexValue": "7369676e6174757265732e6c656e677468203d3d203635", + "id": 862, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12350:25:0", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_596a1fa41ba579d6aea221d825354132f4526efd6f16816b6df5045603592f81", + "typeString": "literal_string \"signatures.length == 65\"" + }, + "value": "signatures.length == 65" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_596a1fa41ba579d6aea221d825354132f4526efd6f16816b6df5045603592f81", + "typeString": "literal_string \"signatures.length == 65\"" + } + ], + "id": 857, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "12318:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 863, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12318:58:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 864, + "nodeType": "ExpressionStatement", + "src": "12318:58:0" + }, + { + "assignments": [ + 866 + ], + "declarations": [ + { + "constant": false, + "id": 866, + "mutability": "mutable", + "name": "v", + "nodeType": "VariableDeclaration", + "scope": 949, + "src": "12386:7:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "typeName": { + "id": 865, + "name": "uint8", + "nodeType": "ElementaryTypeName", + "src": "12386:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "visibility": "internal" + } + ], + "id": 867, + "nodeType": "VariableDeclarationStatement", + "src": "12386:7:0" + }, + { + "assignments": [ + 869 + ], + "declarations": [ + { + "constant": false, + "id": 869, + "mutability": "mutable", + "name": "r", + "nodeType": "VariableDeclaration", + "scope": 949, + "src": "12403:9:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 868, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "12403:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "id": 870, + "nodeType": "VariableDeclarationStatement", + "src": "12403:9:0" + }, + { + "assignments": [ + 872 + ], + "declarations": [ + { + "constant": false, + "id": 872, + "mutability": "mutable", + "name": "s", + "nodeType": "VariableDeclaration", + "scope": 949, + "src": "12422:9:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 871, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "12422:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "id": 873, + "nodeType": "VariableDeclarationStatement", + "src": "12422:9:0" + }, + { + "expression": { + "id": 882, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "components": [ + { + "id": 874, + "name": "v", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 866, + "src": "12442:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + { + "id": 875, + "name": "r", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 869, + "src": "12445:1:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "id": 876, + "name": "s", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 872, + "src": "12448:1:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "id": 877, + "isConstant": false, + "isInlineArray": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "TupleExpression", + "src": "12441:9:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_uint8_$_t_bytes32_$_t_bytes32_$", + "typeString": "tuple(uint8,bytes32,bytes32)" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "id": 879, + "name": "signature", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 842, + "src": "12468:9:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + { + "hexValue": "30", + "id": 880, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12479:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + }, + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 878, + "name": "signatureSplit", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1550, + "src": "12453:14:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$_t_uint256_$returns$_t_uint8_$_t_bytes32_$_t_bytes32_$", + "typeString": "function (bytes memory,uint256) pure returns (uint8,bytes32,bytes32)" + } + }, + "id": 881, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12453:28:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_uint8_$_t_bytes32_$_t_bytes32_$", + "typeString": "tuple(uint8,bytes32,bytes32)" + } + }, + "src": "12441:40:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 883, + "nodeType": "ExpressionStatement", + "src": "12441:40:0" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "id": 886, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 884, + "name": "v", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 866, + "src": "12548:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "30", + "id": 885, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12553:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "12548:6:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "condition": { + "commonType": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "id": 894, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 892, + "name": "v", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 866, + "src": "12653:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "31", + "id": 893, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12658:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "12653:6:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "condition": { + "commonType": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "id": 903, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 901, + "name": "v", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 866, + "src": "12832:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "hexValue": "3330", + "id": 902, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12836:2:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_30_by_1", + "typeString": "int_const 30" + }, + "value": "30" + }, + "src": "12832:6:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "id": 935, + "nodeType": "Block", + "src": "13143:149:0", + "statements": [ + { + "expression": { + "id": 933, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 924, + "name": "owner", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 847, + "src": "13226:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "arguments": [ + { + "id": 927, + "name": "transferHashData", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 844, + "src": "13254:16:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 926, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -8, + "src": "13244:9:0", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 928, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13244:27:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "id": 929, + "name": "v", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 866, + "src": "13273:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + { + "id": 930, + "name": "r", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 869, + "src": "13276:1:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "id": 931, + "name": "s", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 872, + "src": "13279:1:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 925, + "name": "ecrecover", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -6, + "src": "13234:9:0", + "typeDescriptions": { + "typeIdentifier": "t_function_ecrecover_pure$_t_bytes32_$_t_uint8_$_t_bytes32_$_t_bytes32_$returns$_t_address_$", + "typeString": "function (bytes32,uint8,bytes32,bytes32) pure returns (address)" + } + }, + "id": 932, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13234:47:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "13226:55:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 934, + "nodeType": "ExpressionStatement", + "src": "13226:55:0" + } + ] + }, + "id": 936, + "nodeType": "IfStatement", + "src": "12828:464:0", + "trueBody": { + "id": 923, + "nodeType": "Block", + "src": "12840:297:0", + "statements": [ + { + "expression": { + "id": 921, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 904, + "name": "owner", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 847, + "src": "13002:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "arguments": [ + { + "arguments": [ + { + "hexValue": "19457468657265756d205369676e6564204d6573736167653a0a3332", + "id": 909, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13047:34:0", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_178a2411ab6fbc1ba11064408972259c558d0e82fd48b0aba3ad81d14f065e73", + "typeString": "literal_string \"\u0019Ethereum Signed Message:\n32\"" + }, + "value": "\u0019Ethereum Signed Message:\n32" + }, + { + "arguments": [ + { + "id": 911, + "name": "transferHashData", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 844, + "src": "13093:16:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 910, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -8, + "src": "13083:9:0", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 912, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13083:27:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_stringliteral_178a2411ab6fbc1ba11064408972259c558d0e82fd48b0aba3ad81d14f065e73", + "typeString": "literal_string \"\u0019Ethereum Signed Message:\n32\"" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "expression": { + "id": 907, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -1, + "src": "13030:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 908, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "src": "13030:16:0", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 913, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13030:81:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 906, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -8, + "src": "13020:9:0", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 914, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13020:92:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "commonType": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "id": 917, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 915, + "name": "v", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 866, + "src": "13114:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "hexValue": "34", + "id": 916, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13118:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_4_by_1", + "typeString": "int_const 4" + }, + "value": "4" + }, + "src": "13114:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + { + "id": 918, + "name": "r", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 869, + "src": "13121:1:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "id": 919, + "name": "s", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 872, + "src": "13124:1:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 905, + "name": "ecrecover", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -6, + "src": "13010:9:0", + "typeDescriptions": { + "typeIdentifier": "t_function_ecrecover_pure$_t_bytes32_$_t_uint8_$_t_bytes32_$_t_bytes32_$returns$_t_address_$", + "typeString": "function (bytes32,uint8,bytes32,bytes32) pure returns (address)" + } + }, + "id": 920, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13010:116:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "13002:124:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 922, + "nodeType": "ExpressionStatement", + "src": "13002:124:0" + } + ] + } + }, + "id": 937, + "nodeType": "IfStatement", + "src": "12649:643:0", + "trueBody": { + "id": 900, + "nodeType": "Block", + "src": "12661:161:0", + "statements": [ + { + "expression": { + "id": 898, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 895, + "name": "owner", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 847, + "src": "12793:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "expression": { + "id": 896, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "12801:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 897, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "12801:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "src": "12793:18:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 899, + "nodeType": "ExpressionStatement", + "src": "12793:18:0" + } + ] + } + }, + "id": 938, + "nodeType": "IfStatement", + "src": "12544:748:0", + "trueBody": { + "id": 891, + "nodeType": "Block", + "src": "12556:87:0", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "436f6e7472616374207369676e61747572657320617265206e6f7420737570706f727465642062792074686973206d6f64756c65", + "id": 888, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12577:54:0", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_b39fc396439fa2d21053daa8df1e6090b76cf041fa302da73b109291b14237bd", + "typeString": "literal_string \"Contract signatures are not supported by this module\"" + }, + "value": "Contract signatures are not supported by this module" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_stringliteral_b39fc396439fa2d21053daa8df1e6090b76cf041fa302da73b109291b14237bd", + "typeString": "literal_string \"Contract signatures are not supported by this module\"" + } + ], + "id": 887, + "name": "revert", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -19, + -19 + ], + "referencedDeclaration": -19, + "src": "12570:6:0", + "typeDescriptions": { + "typeIdentifier": "t_function_revert_pure$_t_string_memory_ptr_$returns$__$", + "typeString": "function (string memory) pure" + } + }, + "id": 889, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12570:62:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 890, + "nodeType": "ExpressionStatement", + "src": "12570:62:0" + } + ] + } + }, + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 945, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 940, + "name": "owner", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 847, + "src": "13380:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "arguments": [ + { + "hexValue": "30", + "id": 943, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13397:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 942, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "13389:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 941, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "13389:7:0", + "typeDescriptions": {} + } + }, + "id": 944, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13389:10:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "src": "13380:19:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "hexValue": "6f776e657220213d2061646472657373283029", + "id": 946, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13401:21:0", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_fa07c4489b96a4ba6d7948f5dd634975ac28da03dfd4c4c31f4f8e50c9c4d088", + "typeString": "literal_string \"owner != address(0)\"" + }, + "value": "owner != address(0)" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_fa07c4489b96a4ba6d7948f5dd634975ac28da03dfd4c4c31f4f8e50c9c4d088", + "typeString": "literal_string \"owner != address(0)\"" + } + ], + "id": 939, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "13372:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 947, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13372:51:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 948, + "nodeType": "ExpressionStatement", + "src": "13372:51:0" + } + ] + }, + "id": 950, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "recoverSignature", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 845, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 842, + "mutability": "mutable", + "name": "signature", + "nodeType": "VariableDeclaration", + "scope": 950, + "src": "12005:22:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 841, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "12005:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 844, + "mutability": "mutable", + "name": "transferHashData", + "nodeType": "VariableDeclaration", + "scope": 950, + "src": "12029:29:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 843, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "12029:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "src": "12004:55:0" + }, + "returnParameters": { + "id": 848, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 847, + "mutability": "mutable", + "name": "owner", + "nodeType": "VariableDeclaration", + "scope": 950, + "src": "12082:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 846, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "12082:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "12081:15:0" + }, + "scope": 1428, + "src": "11979:1451:0", + "stateMutability": "view", + "virtual": false, + "visibility": "private" + }, + { + "body": { + "id": 1005, + "nodeType": "Block", + "src": "13529:476:0", + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 966, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 961, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 954, + "src": "13543:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "arguments": [ + { + "hexValue": "30", + "id": 964, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13560:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 963, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "13552:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 962, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "13552:7:0", + "typeDescriptions": {} + } + }, + "id": 965, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13552:10:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "src": "13543:19:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "id": 1003, + "nodeType": "Block", + "src": "13764:235:0", + "statements": [ + { + "assignments": [ + 982 + ], + "declarations": [ + { + "constant": false, + "id": 982, + "mutability": "mutable", + "name": "data", + "nodeType": "VariableDeclaration", + "scope": 1003, + "src": "13778:17:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 981, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "13778:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "id": 989, + "initialValue": { + "arguments": [ + { + "hexValue": "7472616e7366657228616464726573732c75696e7432353629", + "id": 985, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13822:27:0", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_a9059cbb2ab09eb219583f4a59a5d0623ade346d962bcd4e46b11da047c9049b", + "typeString": "literal_string \"transfer(address,uint256)\"" + }, + "value": "transfer(address,uint256)" + }, + { + "id": 986, + "name": "to", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 956, + "src": "13851:2:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "id": 987, + "name": "amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 958, + "src": "13855:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_stringliteral_a9059cbb2ab09eb219583f4a59a5d0623ade346d962bcd4e46b11da047c9049b", + "typeString": "literal_string \"transfer(address,uint256)\"" + }, + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + ], + "expression": { + "id": 983, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -1, + "src": "13798:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 984, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encodeWithSignature", + "nodeType": "MemberAccess", + "src": "13798:23:0", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodewithsignature_pure$_t_string_memory_ptr_$returns$_t_bytes_memory_ptr_$", + "typeString": "function (string memory) pure returns (bytes memory)" + } + }, + "id": 988, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13798:64:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "13778:84:0" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "id": 993, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 954, + "src": "13915:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "hexValue": "30", + "id": 994, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13922:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + { + "id": 995, + "name": "data", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 982, + "src": "13925:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + { + "expression": { + "expression": { + "id": 996, + "name": "Enum", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1435, + "src": "13931:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_Enum_$1435_$", + "typeString": "type(contract Enum)" + } + }, + "id": 997, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "Operation", + "nodeType": "MemberAccess", + "referencedDeclaration": 1434, + "src": "13931:14:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Operation_$1434_$", + "typeString": "type(enum Enum.Operation)" + } + }, + "id": 998, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "Call", + "nodeType": "MemberAccess", + "src": "13931:19:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Operation_$1434", + "typeString": "enum Enum.Operation" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + }, + { + "typeIdentifier": "t_enum$_Operation_$1434", + "typeString": "enum Enum.Operation" + } + ], + "expression": { + "id": 991, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 952, + "src": "13884:4:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + }, + "id": 992, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "execTransactionFromModule", + "nodeType": "MemberAccess", + "referencedDeclaration": 17, + "src": "13884:30:0", + "typeDescriptions": { + "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$_t_bytes_memory_ptr_$_t_enum$_Operation_$1434_$returns$_t_bool_$", + "typeString": "function (address,uint256,bytes memory,enum Enum.Operation) external returns (bool)" + } + }, + "id": 999, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13884:67:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "hexValue": "436f756c64206e6f74206578656375746520746f6b656e207472616e73666572", + "id": 1000, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13953:34:0", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_00c0b742664159361be6aebbe2af44c4ae7eb95e13260265d1e1cf75d2593709", + "typeString": "literal_string \"Could not execute token transfer\"" + }, + "value": "Could not execute token transfer" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_00c0b742664159361be6aebbe2af44c4ae7eb95e13260265d1e1cf75d2593709", + "typeString": "literal_string \"Could not execute token transfer\"" + } + ], + "id": 990, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "13876:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1001, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13876:112:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1002, + "nodeType": "ExpressionStatement", + "src": "13876:112:0" + } + ] + }, + "id": 1004, + "nodeType": "IfStatement", + "src": "13539:460:0", + "trueBody": { + "id": 980, + "nodeType": "Block", + "src": "13564:194:0", + "statements": [ + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "id": 970, + "name": "to", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 956, + "src": "13674:2:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "id": 971, + "name": "amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 958, + "src": "13678:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + { + "hexValue": "", + "id": 972, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13686:2:0", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470", + "typeString": "literal_string \"\"" + }, + "value": "" + }, + { + "expression": { + "expression": { + "id": 973, + "name": "Enum", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1435, + "src": "13690:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_Enum_$1435_$", + "typeString": "type(contract Enum)" + } + }, + "id": 974, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "Operation", + "nodeType": "MemberAccess", + "referencedDeclaration": 1434, + "src": "13690:14:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Operation_$1434_$", + "typeString": "type(enum Enum.Operation)" + } + }, + "id": 975, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "Call", + "nodeType": "MemberAccess", + "src": "13690:19:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Operation_$1434", + "typeString": "enum Enum.Operation" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + { + "typeIdentifier": "t_stringliteral_c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470", + "typeString": "literal_string \"\"" + }, + { + "typeIdentifier": "t_enum$_Operation_$1434", + "typeString": "enum Enum.Operation" + } + ], + "expression": { + "id": 968, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 952, + "src": "13643:4:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + }, + "id": 969, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "execTransactionFromModule", + "nodeType": "MemberAccess", + "referencedDeclaration": 17, + "src": "13643:30:0", + "typeDescriptions": { + "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$_t_bytes_memory_ptr_$_t_enum$_Operation_$1434_$returns$_t_bool_$", + "typeString": "function (address,uint256,bytes memory,enum Enum.Operation) external returns (bool)" + } + }, + "id": 976, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13643:67:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "hexValue": "436f756c64206e6f742065786563757465206574686572207472616e73666572", + "id": 977, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13712:34:0", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_2fae53cac084168982e43888b6e5eff084959ab65d511777b56b4cbb265d2586", + "typeString": "literal_string \"Could not execute ether transfer\"" + }, + "value": "Could not execute ether transfer" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_2fae53cac084168982e43888b6e5eff084959ab65d511777b56b4cbb265d2586", + "typeString": "literal_string \"Could not execute ether transfer\"" + } + ], + "id": 967, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "13635:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 978, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13635:112:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 979, + "nodeType": "ExpressionStatement", + "src": "13635:112:0" + } + ] + } + } + ] + }, + "id": 1006, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "transfer", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 959, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 952, + "mutability": "mutable", + "name": "safe", + "nodeType": "VariableDeclaration", + "scope": 1006, + "src": "13454:15:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + }, + "typeName": { + "id": 951, + "name": "GnosisSafe", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 18, + "src": "13454:10:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 954, + "mutability": "mutable", + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 1006, + "src": "13471:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 953, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "13471:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 956, + "mutability": "mutable", + "name": "to", + "nodeType": "VariableDeclaration", + "scope": 1006, + "src": "13486:18:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + "typeName": { + "id": 955, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "13486:15:0", + "stateMutability": "payable", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 958, + "mutability": "mutable", + "name": "amount", + "nodeType": "VariableDeclaration", + "scope": 1006, + "src": "13506:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "typeName": { + "id": 957, + "name": "uint96", + "nodeType": "ElementaryTypeName", + "src": "13506:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "visibility": "internal" + } + ], + "src": "13453:67:0" + }, + "returnParameters": { + "id": 960, + "nodeType": "ParameterList", + "parameters": [], + "src": "13529:0:0" + }, + "scope": 1428, + "src": "13436:569:0", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "private" + }, + { + "body": { + "id": 1022, + "nodeType": "Block", + "src": "14101:46:0", + "statements": [ + { + "expression": { + "baseExpression": { + "baseExpression": { + "id": 1016, + "name": "tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 47, + "src": "14118:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_array$_t_address_$dyn_storage_$_$", + "typeString": "mapping(address => mapping(address => address[] storage ref))" + } + }, + "id": 1018, + "indexExpression": { + "id": 1017, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1008, + "src": "14125:4:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "14118:12:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_array$_t_address_$dyn_storage_$", + "typeString": "mapping(address => address[] storage ref)" + } + }, + "id": 1020, + "indexExpression": { + "id": 1019, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1010, + "src": "14131:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "14118:22:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "functionReturnParameters": 1015, + "id": 1021, + "nodeType": "Return", + "src": "14111:29:0" + } + ] + }, + "functionSelector": "8d0e8e1d", + "id": 1023, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getTokens", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1011, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1008, + "mutability": "mutable", + "name": "safe", + "nodeType": "VariableDeclaration", + "scope": 1023, + "src": "14030:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1007, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "14030:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1010, + "mutability": "mutable", + "name": "delegate", + "nodeType": "VariableDeclaration", + "scope": 1023, + "src": "14044:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1009, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "14044:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "14029:32:0" + }, + "returnParameters": { + "id": 1015, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1014, + "mutability": "mutable", + "name": "", + "nodeType": "VariableDeclaration", + "scope": 1023, + "src": "14083:16:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[]" + }, + "typeName": { + "baseType": { + "id": 1012, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "14083:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 1013, + "nodeType": "ArrayTypeName", + "src": "14083:9:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + } + }, + "visibility": "internal" + } + ], + "src": "14082:18:0" + }, + "scope": 1428, + "src": "14011:136:0", + "stateMutability": "view", + "virtual": false, + "visibility": "public" + }, + { + "body": { + "id": 1071, + "nodeType": "Block", + "src": "14267:313:0", + "statements": [ + { + "assignments": [ + 1037 + ], + "declarations": [ + { + "constant": false, + "id": 1037, + "mutability": "mutable", + "name": "allowance", + "nodeType": "VariableDeclaration", + "scope": 1071, + "src": "14277:26:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance" + }, + "typeName": { + "id": 1036, + "name": "Allowance", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 75, + "src": "14277:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_storage_ptr", + "typeString": "struct AllowanceModule.Allowance" + } + }, + "visibility": "internal" + } + ], + "id": 1043, + "initialValue": { + "arguments": [ + { + "id": 1039, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1025, + "src": "14319:4:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 1040, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1027, + "src": "14325:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 1041, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1029, + "src": "14335:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 1038, + "name": "getAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 360, + "src": "14306:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_address_$_t_address_$_t_address_$returns$_t_struct$_Allowance_$75_memory_ptr_$", + "typeString": "function (address,address,address) view returns (struct AllowanceModule.Allowance memory)" + } + }, + "id": 1042, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "14306:35:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "14277:64:0" + }, + { + "expression": { + "components": [ + { + "arguments": [ + { + "expression": { + "id": 1046, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1037, + "src": "14380:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 1047, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "amount", + "nodeType": "MemberAccess", + "referencedDeclaration": 66, + "src": "14380:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + ], + "id": 1045, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "14372:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + }, + "typeName": { + "id": 1044, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "14372:7:0", + "typeDescriptions": {} + } + }, + "id": 1048, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "14372:25:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "arguments": [ + { + "expression": { + "id": 1051, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1037, + "src": "14419:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 1052, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "spent", + "nodeType": "MemberAccess", + "referencedDeclaration": 68, + "src": "14419:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + ], + "id": 1050, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "14411:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + }, + "typeName": { + "id": 1049, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "14411:7:0", + "typeDescriptions": {} + } + }, + "id": 1053, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "14411:24:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "arguments": [ + { + "expression": { + "id": 1056, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1037, + "src": "14457:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 1057, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "resetTimeMin", + "nodeType": "MemberAccess", + "referencedDeclaration": 70, + "src": "14457:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + ], + "id": 1055, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "14449:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + }, + "typeName": { + "id": 1054, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "14449:7:0", + "typeDescriptions": {} + } + }, + "id": 1058, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "14449:31:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "arguments": [ + { + "expression": { + "id": 1061, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1037, + "src": "14502:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 1062, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "lastResetMin", + "nodeType": "MemberAccess", + "referencedDeclaration": 72, + "src": "14502:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + ], + "id": 1060, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "14494:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + }, + "typeName": { + "id": 1059, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "14494:7:0", + "typeDescriptions": {} + } + }, + "id": 1063, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "14494:31:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "arguments": [ + { + "expression": { + "id": 1066, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1037, + "src": "14547:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 1067, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "nonce", + "nodeType": "MemberAccess", + "referencedDeclaration": 74, + "src": "14547:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + ], + "id": 1065, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "14539:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + }, + "typeName": { + "id": 1064, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "14539:7:0", + "typeDescriptions": {} + } + }, + "id": 1068, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "14539:24:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 1069, + "isConstant": false, + "isInlineArray": true, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "14358:215:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$5_memory_ptr", + "typeString": "uint256[5] memory" + } + }, + "functionReturnParameters": 1035, + "id": 1070, + "nodeType": "Return", + "src": "14351:222:0" + } + ] + }, + "functionSelector": "94b31fbd", + "id": 1072, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getTokenAllowance", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1030, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1025, + "mutability": "mutable", + "name": "safe", + "nodeType": "VariableDeclaration", + "scope": 1072, + "src": "14180:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1024, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "14180:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1027, + "mutability": "mutable", + "name": "delegate", + "nodeType": "VariableDeclaration", + "scope": 1072, + "src": "14194:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1026, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "14194:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1029, + "mutability": "mutable", + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 1072, + "src": "14212:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1028, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "14212:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "14179:47:0" + }, + "returnParameters": { + "id": 1035, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1034, + "mutability": "mutable", + "name": "", + "nodeType": "VariableDeclaration", + "scope": 1072, + "src": "14248:17:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$5_memory_ptr", + "typeString": "uint256[5]" + }, + "typeName": { + "baseType": { + "id": 1031, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "14248:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 1033, + "length": { + "hexValue": "35", + "id": 1032, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "14256:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_5_by_1", + "typeString": "int_const 5" + }, + "value": "5" + }, + "nodeType": "ArrayTypeName", + "src": "14248:10:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$5_storage_ptr", + "typeString": "uint256[5]" + } + }, + "visibility": "internal" + } + ], + "src": "14247:19:0" + }, + "scope": 1428, + "src": "14153:427:0", + "stateMutability": "view", + "virtual": false, + "visibility": "public" + }, + { + "body": { + "id": 1164, + "nodeType": "Block", + "src": "14726:727:0", + "statements": [ + { + "assignments": [ + 1079 + ], + "declarations": [ + { + "constant": false, + "id": 1079, + "mutability": "mutable", + "name": "index", + "nodeType": "VariableDeclaration", + "scope": 1164, + "src": "14736:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + }, + "typeName": { + "id": 1078, + "name": "uint48", + "nodeType": "ElementaryTypeName", + "src": "14736:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "visibility": "internal" + } + ], + "id": 1084, + "initialValue": { + "arguments": [ + { + "id": 1082, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1075, + "src": "14758:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 1081, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "14751:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint48_$", + "typeString": "type(uint48)" + }, + "typeName": { + "id": 1080, + "name": "uint48", + "nodeType": "ElementaryTypeName", + "src": "14751:6:0", + "typeDescriptions": {} + } + }, + "id": 1083, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "14751:16:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "14736:31:0" + }, + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 1091, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 1086, + "name": "index", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1079, + "src": "14785:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "arguments": [ + { + "hexValue": "30", + "id": 1089, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "14799:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 1088, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "14794:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + }, + "typeName": { + "id": 1087, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "14794:4:0", + "typeDescriptions": {} + } + }, + "id": 1090, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "14794:7:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "14785:16:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "hexValue": "696e64657820213d2075696e74283029", + "id": 1092, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "14803:18:0", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_4a2d9edd74f24662f88947ce284e3a1e9e02725c0905850305b1ce7e8ee456f2", + "typeString": "literal_string \"index != uint(0)\"" + }, + "value": "index != uint(0)" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_4a2d9edd74f24662f88947ce284e3a1e9e02725c0905850305b1ce7e8ee456f2", + "typeString": "literal_string \"index != uint(0)\"" + } + ], + "id": 1085, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "14777:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1093, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "14777:45:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1094, + "nodeType": "ExpressionStatement", + "src": "14777:45:0" + }, + { + "assignments": [ + 1096 + ], + "declarations": [ + { + "constant": false, + "id": 1096, + "mutability": "mutable", + "name": "currentDelegate", + "nodeType": "VariableDeclaration", + "scope": 1164, + "src": "14832:23:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1095, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "14832:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "id": 1104, + "initialValue": { + "expression": { + "baseExpression": { + "baseExpression": { + "id": 1097, + "name": "delegates", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 57, + "src": "14858:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_uint48_$_t_struct$_Delegate_$64_storage_$_$", + "typeString": "mapping(address => mapping(uint48 => struct AllowanceModule.Delegate storage ref))" + } + }, + "id": 1100, + "indexExpression": { + "expression": { + "id": 1098, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "14868:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1099, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "14868:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "14858:21:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint48_$_t_struct$_Delegate_$64_storage_$", + "typeString": "mapping(uint48 => struct AllowanceModule.Delegate storage ref)" + } + }, + "id": 1102, + "indexExpression": { + "id": 1101, + "name": "index", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1079, + "src": "14880:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "14858:28:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$64_storage", + "typeString": "struct AllowanceModule.Delegate storage ref" + } + }, + "id": 1103, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "delegate", + "nodeType": "MemberAccess", + "referencedDeclaration": 59, + "src": "14858:37:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "14832:63:0" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 1110, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 1105, + "name": "currentDelegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1096, + "src": "14908:15:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "arguments": [ + { + "hexValue": "30", + "id": 1108, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "14935:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 1107, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "14927:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 1106, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "14927:7:0", + "typeDescriptions": {} + } + }, + "id": 1109, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "14927:10:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "src": "14908:29:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 1120, + "nodeType": "IfStatement", + "src": "14905:264:0", + "trueBody": { + "id": 1119, + "nodeType": "Block", + "src": "14939:230:0", + "statements": [ + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 1114, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 1112, + "name": "currentDelegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1096, + "src": "15025:15:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "id": 1113, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1075, + "src": "15044:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "15025:27:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "hexValue": "63757272656e7444656c6567617465203d3d2064656c6567617465", + "id": 1115, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "15054:29:0", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_015a46159767c793786ac6026f0bf920b0e1b83347241b23bbb8e98c67f949b3", + "typeString": "literal_string \"currentDelegate == delegate\"" + }, + "value": "currentDelegate == delegate" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_015a46159767c793786ac6026f0bf920b0e1b83347241b23bbb8e98c67f949b3", + "typeString": "literal_string \"currentDelegate == delegate\"" + } + ], + "id": 1111, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "15017:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1116, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "15017:67:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1117, + "nodeType": "ExpressionStatement", + "src": "15017:67:0" + }, + { + "functionReturnParameters": 1077, + "id": 1118, + "nodeType": "Return", + "src": "15152:7:0" + } + ] + } + }, + { + "assignments": [ + 1122 + ], + "declarations": [ + { + "constant": false, + "id": 1122, + "mutability": "mutable", + "name": "startIndex", + "nodeType": "VariableDeclaration", + "scope": 1164, + "src": "15178:17:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + }, + "typeName": { + "id": 1121, + "name": "uint48", + "nodeType": "ElementaryTypeName", + "src": "15178:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "visibility": "internal" + } + ], + "id": 1127, + "initialValue": { + "baseExpression": { + "id": 1123, + "name": "delegatesStart", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 51, + "src": "15198:14:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint48_$", + "typeString": "mapping(address => uint48)" + } + }, + "id": 1126, + "indexExpression": { + "expression": { + "id": 1124, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "15213:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1125, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "15213:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "15198:26:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "15178:46:0" + }, + { + "expression": { + "id": 1139, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "baseExpression": { + "baseExpression": { + "id": 1128, + "name": "delegates", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 57, + "src": "15234:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_uint48_$_t_struct$_Delegate_$64_storage_$_$", + "typeString": "mapping(address => mapping(uint48 => struct AllowanceModule.Delegate storage ref))" + } + }, + "id": 1132, + "indexExpression": { + "expression": { + "id": 1129, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "15244:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1130, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "15244:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "15234:21:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint48_$_t_struct$_Delegate_$64_storage_$", + "typeString": "mapping(uint48 => struct AllowanceModule.Delegate storage ref)" + } + }, + "id": 1133, + "indexExpression": { + "id": 1131, + "name": "index", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1079, + "src": "15256:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "15234:28:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$64_storage", + "typeString": "struct AllowanceModule.Delegate storage ref" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "id": 1135, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1075, + "src": "15274:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "hexValue": "30", + "id": 1136, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "15284:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + { + "id": 1137, + "name": "startIndex", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1122, + "src": "15287:10:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + ], + "id": 1134, + "name": "Delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 64, + "src": "15265:8:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_struct$_Delegate_$64_storage_ptr_$", + "typeString": "type(struct AllowanceModule.Delegate storage pointer)" + } + }, + "id": 1138, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "structConstructorCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "15265:33:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$64_memory_ptr", + "typeString": "struct AllowanceModule.Delegate memory" + } + }, + "src": "15234:64:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$64_storage", + "typeString": "struct AllowanceModule.Delegate storage ref" + } + }, + "id": 1140, + "nodeType": "ExpressionStatement", + "src": "15234:64:0" + }, + { + "expression": { + "id": 1149, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "baseExpression": { + "baseExpression": { + "id": 1141, + "name": "delegates", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 57, + "src": "15308:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_uint48_$_t_struct$_Delegate_$64_storage_$_$", + "typeString": "mapping(address => mapping(uint48 => struct AllowanceModule.Delegate storage ref))" + } + }, + "id": 1145, + "indexExpression": { + "expression": { + "id": 1142, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "15318:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1143, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "15318:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "15308:21:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint48_$_t_struct$_Delegate_$64_storage_$", + "typeString": "mapping(uint48 => struct AllowanceModule.Delegate storage ref)" + } + }, + "id": 1146, + "indexExpression": { + "id": 1144, + "name": "startIndex", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1122, + "src": "15330:10:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "15308:33:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$64_storage", + "typeString": "struct AllowanceModule.Delegate storage ref" + } + }, + "id": 1147, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "prev", + "nodeType": "MemberAccess", + "referencedDeclaration": 61, + "src": "15308:38:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "id": 1148, + "name": "index", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1079, + "src": "15349:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "src": "15308:46:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "id": 1150, + "nodeType": "ExpressionStatement", + "src": "15308:46:0" + }, + { + "expression": { + "id": 1156, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "baseExpression": { + "id": 1151, + "name": "delegatesStart", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 51, + "src": "15364:14:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint48_$", + "typeString": "mapping(address => uint48)" + } + }, + "id": 1154, + "indexExpression": { + "expression": { + "id": 1152, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "15379:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1153, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "15379:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "15364:26:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "id": 1155, + "name": "index", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1079, + "src": "15393:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "src": "15364:34:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "id": 1157, + "nodeType": "ExpressionStatement", + "src": "15364:34:0" + }, + { + "eventCall": { + "arguments": [ + { + "expression": { + "id": 1159, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "15425:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1160, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "15425:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "id": 1161, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1075, + "src": "15437:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 1158, + "name": "AddDelegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 81, + "src": "15413:11:0", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$returns$__$", + "typeString": "function (address,address)" + } + }, + "id": 1162, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "15413:33:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1163, + "nodeType": "EmitStatement", + "src": "15408:38:0" + } + ] + }, + "documentation": { + "id": 1073, + "nodeType": "StructuredDocumentation", + "src": "14586:89:0", + "text": "@dev Allows to add a delegate.\n @param delegate Delegate that should be added." + }, + "functionSelector": "e71bdf41", + "id": 1165, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "addDelegate", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1076, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1075, + "mutability": "mutable", + "name": "delegate", + "nodeType": "VariableDeclaration", + "scope": 1165, + "src": "14701:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1074, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "14701:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "14700:18:0" + }, + "returnParameters": { + "id": 1077, + "nodeType": "ParameterList", + "parameters": [], + "src": "14726:0:0" + }, + "scope": 1428, + "src": "14680:773:0", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "public" + }, + { + "body": { + "id": 1338, + "nodeType": "Block", + "src": "15853:1293:0", + "statements": [ + { + "assignments": [ + 1174 + ], + "declarations": [ + { + "constant": false, + "id": 1174, + "mutability": "mutable", + "name": "current", + "nodeType": "VariableDeclaration", + "scope": 1338, + "src": "15863:23:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$64_memory_ptr", + "typeString": "struct AllowanceModule.Delegate" + }, + "typeName": { + "id": 1173, + "name": "Delegate", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 64, + "src": "15863:8:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$64_storage_ptr", + "typeString": "struct AllowanceModule.Delegate" + } + }, + "visibility": "internal" + } + ], + "id": 1184, + "initialValue": { + "baseExpression": { + "baseExpression": { + "id": 1175, + "name": "delegates", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 57, + "src": "15889:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_uint48_$_t_struct$_Delegate_$64_storage_$_$", + "typeString": "mapping(address => mapping(uint48 => struct AllowanceModule.Delegate storage ref))" + } + }, + "id": 1178, + "indexExpression": { + "expression": { + "id": 1176, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "15899:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1177, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "15899:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "15889:21:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint48_$_t_struct$_Delegate_$64_storage_$", + "typeString": "mapping(uint48 => struct AllowanceModule.Delegate storage ref)" + } + }, + "id": 1183, + "indexExpression": { + "arguments": [ + { + "id": 1181, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1168, + "src": "15918:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 1180, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "15911:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint48_$", + "typeString": "type(uint48)" + }, + "typeName": { + "id": 1179, + "name": "uint48", + "nodeType": "ElementaryTypeName", + "src": "15911:6:0", + "typeDescriptions": {} + } + }, + "id": 1182, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "15911:16:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "15889:39:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$64_storage", + "typeString": "struct AllowanceModule.Delegate storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "15863:65:0" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 1191, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 1185, + "name": "current", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1174, + "src": "15991:7:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$64_memory_ptr", + "typeString": "struct AllowanceModule.Delegate memory" + } + }, + "id": 1186, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "delegate", + "nodeType": "MemberAccess", + "referencedDeclaration": 59, + "src": "15991:16:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "arguments": [ + { + "hexValue": "30", + "id": 1189, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "16019:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 1188, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "16011:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 1187, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "16011:7:0", + "typeDescriptions": {} + } + }, + "id": 1190, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "16011:10:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "src": "15991:30:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 1193, + "nodeType": "IfStatement", + "src": "15988:42:0", + "trueBody": { + "functionReturnParameters": 1172, + "id": 1192, + "nodeType": "Return", + "src": "16023:7:0" + } + }, + { + "condition": { + "id": 1194, + "name": "removeAllowances", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1170, + "src": "16043:16:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 1275, + "nodeType": "IfStatement", + "src": "16039:698:0", + "trueBody": { + "id": 1274, + "nodeType": "Block", + "src": "16061:676:0", + "statements": [ + { + "assignments": [ + 1199 + ], + "declarations": [ + { + "constant": false, + "id": 1199, + "mutability": "mutable", + "name": "delegateTokens", + "nodeType": "VariableDeclaration", + "scope": 1274, + "src": "16075:32:0", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + }, + "typeName": { + "baseType": { + "id": 1197, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "16075:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 1198, + "nodeType": "ArrayTypeName", + "src": "16075:9:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + } + }, + "visibility": "internal" + } + ], + "id": 1206, + "initialValue": { + "baseExpression": { + "baseExpression": { + "id": 1200, + "name": "tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 47, + "src": "16110:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_array$_t_address_$dyn_storage_$_$", + "typeString": "mapping(address => mapping(address => address[] storage ref))" + } + }, + "id": 1203, + "indexExpression": { + "expression": { + "id": 1201, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "16117:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1202, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "16117:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "16110:18:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_array$_t_address_$dyn_storage_$", + "typeString": "mapping(address => address[] storage ref)" + } + }, + "id": 1205, + "indexExpression": { + "id": 1204, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1168, + "src": "16129:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "16110:28:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "16075:63:0" + }, + { + "body": { + "id": 1272, + "nodeType": "Block", + "src": "16204:523:0", + "statements": [ + { + "assignments": [ + 1219 + ], + "declarations": [ + { + "constant": false, + "id": 1219, + "mutability": "mutable", + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 1272, + "src": "16222:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1218, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "16222:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "id": 1223, + "initialValue": { + "baseExpression": { + "id": 1220, + "name": "delegateTokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1199, + "src": "16238:14:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[] storage pointer" + } + }, + "id": 1222, + "indexExpression": { + "id": 1221, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1208, + "src": "16253:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "16238:17:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "16222:33:0" + }, + { + "assignments": [ + 1225 + ], + "declarations": [ + { + "constant": false, + "id": 1225, + "mutability": "mutable", + "name": "allowance", + "nodeType": "VariableDeclaration", + "scope": 1272, + "src": "16339:26:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance" + }, + "typeName": { + "id": 1224, + "name": "Allowance", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 75, + "src": "16339:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_storage_ptr", + "typeString": "struct AllowanceModule.Allowance" + } + }, + "visibility": "internal" + } + ], + "id": 1232, + "initialValue": { + "arguments": [ + { + "expression": { + "id": 1227, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "16381:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1228, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "16381:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "id": 1229, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1168, + "src": "16393:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 1230, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1219, + "src": "16403:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 1226, + "name": "getAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 360, + "src": "16368:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_address_$_t_address_$_t_address_$returns$_t_struct$_Allowance_$75_memory_ptr_$", + "typeString": "function (address,address,address) view returns (struct AllowanceModule.Allowance memory)" + } + }, + "id": 1231, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "16368:41:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "16339:70:0" + }, + { + "expression": { + "id": 1237, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 1233, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1225, + "src": "16427:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 1235, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "amount", + "nodeType": "MemberAccess", + "referencedDeclaration": 66, + "src": "16427:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "hexValue": "30", + "id": 1236, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "16446:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "16427:20:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "id": 1238, + "nodeType": "ExpressionStatement", + "src": "16427:20:0" + }, + { + "expression": { + "id": 1243, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 1239, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1225, + "src": "16465:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 1241, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "spent", + "nodeType": "MemberAccess", + "referencedDeclaration": 68, + "src": "16465:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "hexValue": "30", + "id": 1242, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "16483:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "16465:19:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "id": 1244, + "nodeType": "ExpressionStatement", + "src": "16465:19:0" + }, + { + "expression": { + "id": 1249, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 1245, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1225, + "src": "16502:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 1247, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "resetTimeMin", + "nodeType": "MemberAccess", + "referencedDeclaration": 70, + "src": "16502:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "hexValue": "30", + "id": 1248, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "16527:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "16502:26:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "id": 1250, + "nodeType": "ExpressionStatement", + "src": "16502:26:0" + }, + { + "expression": { + "id": 1255, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 1251, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1225, + "src": "16546:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 1253, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "lastResetMin", + "nodeType": "MemberAccess", + "referencedDeclaration": 72, + "src": "16546:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "hexValue": "30", + "id": 1254, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "16571:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "16546:26:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "id": 1256, + "nodeType": "ExpressionStatement", + "src": "16546:26:0" + }, + { + "expression": { + "arguments": [ + { + "expression": { + "id": 1258, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "16606:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1259, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "16606:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "id": 1260, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1168, + "src": "16618:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 1261, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1219, + "src": "16628:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 1262, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1225, + "src": "16635:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + ], + "id": 1257, + "name": "updateAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 382, + "src": "16590:15:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_address_$_t_struct$_Allowance_$75_memory_ptr_$returns$__$", + "typeString": "function (address,address,address,struct AllowanceModule.Allowance memory)" + } + }, + "id": 1263, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "16590:55:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1264, + "nodeType": "ExpressionStatement", + "src": "16590:55:0" + }, + { + "eventCall": { + "arguments": [ + { + "expression": { + "id": 1266, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "16684:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1267, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "16684:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "id": 1268, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1168, + "src": "16696:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 1269, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1219, + "src": "16706:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 1265, + "name": "DeleteAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 141, + "src": "16668:15:0", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_address_$returns$__$", + "typeString": "function (address,address,address)" + } + }, + "id": 1270, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "16668:44:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1271, + "nodeType": "EmitStatement", + "src": "16663:49:0" + } + ] + }, + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 1214, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 1211, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1208, + "src": "16172:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "expression": { + "id": 1212, + "name": "delegateTokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1199, + "src": "16176:14:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[] storage pointer" + } + }, + "id": 1213, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "length", + "nodeType": "MemberAccess", + "src": "16176:21:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "16172:25:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 1273, + "initializationExpression": { + "assignments": [ + 1208 + ], + "declarations": [ + { + "constant": false, + "id": 1208, + "mutability": "mutable", + "name": "i", + "nodeType": "VariableDeclaration", + "scope": 1273, + "src": "16157:9:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1207, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "16157:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 1210, + "initialValue": { + "hexValue": "30", + "id": 1209, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "16169:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "nodeType": "VariableDeclarationStatement", + "src": "16157:13:0" + }, + "loopExpression": { + "expression": { + "id": 1216, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "16199:3:0", + "subExpression": { + "id": 1215, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1208, + "src": "16199:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 1217, + "nodeType": "ExpressionStatement", + "src": "16199:3:0" + }, + "nodeType": "ForStatement", + "src": "16152:575:0" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + }, + "id": 1279, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 1276, + "name": "current", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1174, + "src": "16750:7:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$64_memory_ptr", + "typeString": "struct AllowanceModule.Delegate memory" + } + }, + "id": 1277, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "prev", + "nodeType": "MemberAccess", + "referencedDeclaration": 61, + "src": "16750:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "30", + "id": 1278, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "16766:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "16750:17:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "id": 1301, + "nodeType": "Block", + "src": "16841:80:0", + "statements": [ + { + "expression": { + "id": 1299, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "baseExpression": { + "baseExpression": { + "id": 1289, + "name": "delegates", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 57, + "src": "16855:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_uint48_$_t_struct$_Delegate_$64_storage_$_$", + "typeString": "mapping(address => mapping(uint48 => struct AllowanceModule.Delegate storage ref))" + } + }, + "id": 1294, + "indexExpression": { + "expression": { + "id": 1290, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "16865:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1291, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "16865:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "16855:21:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint48_$_t_struct$_Delegate_$64_storage_$", + "typeString": "mapping(uint48 => struct AllowanceModule.Delegate storage ref)" + } + }, + "id": 1295, + "indexExpression": { + "expression": { + "id": 1292, + "name": "current", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1174, + "src": "16877:7:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$64_memory_ptr", + "typeString": "struct AllowanceModule.Delegate memory" + } + }, + "id": 1293, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "prev", + "nodeType": "MemberAccess", + "referencedDeclaration": 61, + "src": "16877:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "16855:35:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$64_storage", + "typeString": "struct AllowanceModule.Delegate storage ref" + } + }, + "id": 1296, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "next", + "nodeType": "MemberAccess", + "referencedDeclaration": 63, + "src": "16855:40:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "expression": { + "id": 1297, + "name": "current", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1174, + "src": "16898:7:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$64_memory_ptr", + "typeString": "struct AllowanceModule.Delegate memory" + } + }, + "id": 1298, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "next", + "nodeType": "MemberAccess", + "referencedDeclaration": 63, + "src": "16898:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "src": "16855:55:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "id": 1300, + "nodeType": "ExpressionStatement", + "src": "16855:55:0" + } + ] + }, + "id": 1302, + "nodeType": "IfStatement", + "src": "16746:175:0", + "trueBody": { + "id": 1288, + "nodeType": "Block", + "src": "16769:66:0", + "statements": [ + { + "expression": { + "id": 1286, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "baseExpression": { + "id": 1280, + "name": "delegatesStart", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 51, + "src": "16783:14:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint48_$", + "typeString": "mapping(address => uint48)" + } + }, + "id": 1283, + "indexExpression": { + "expression": { + "id": 1281, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "16798:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1282, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "16798:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "16783:26:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "expression": { + "id": 1284, + "name": "current", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1174, + "src": "16812:7:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$64_memory_ptr", + "typeString": "struct AllowanceModule.Delegate memory" + } + }, + "id": 1285, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "next", + "nodeType": "MemberAccess", + "referencedDeclaration": 63, + "src": "16812:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "src": "16783:41:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "id": 1287, + "nodeType": "ExpressionStatement", + "src": "16783:41:0" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + }, + "id": 1306, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 1303, + "name": "current", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1174, + "src": "16934:7:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$64_memory_ptr", + "typeString": "struct AllowanceModule.Delegate memory" + } + }, + "id": 1304, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "next", + "nodeType": "MemberAccess", + "referencedDeclaration": 63, + "src": "16934:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "hexValue": "30", + "id": 1305, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "16950:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "16934:17:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 1320, + "nodeType": "IfStatement", + "src": "16930:103:0", + "trueBody": { + "id": 1319, + "nodeType": "Block", + "src": "16953:80:0", + "statements": [ + { + "expression": { + "id": 1317, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "baseExpression": { + "baseExpression": { + "id": 1307, + "name": "delegates", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 57, + "src": "16967:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_uint48_$_t_struct$_Delegate_$64_storage_$_$", + "typeString": "mapping(address => mapping(uint48 => struct AllowanceModule.Delegate storage ref))" + } + }, + "id": 1312, + "indexExpression": { + "expression": { + "id": 1308, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "16977:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1309, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "16977:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "16967:21:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint48_$_t_struct$_Delegate_$64_storage_$", + "typeString": "mapping(uint48 => struct AllowanceModule.Delegate storage ref)" + } + }, + "id": 1313, + "indexExpression": { + "expression": { + "id": 1310, + "name": "current", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1174, + "src": "16989:7:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$64_memory_ptr", + "typeString": "struct AllowanceModule.Delegate memory" + } + }, + "id": 1311, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "next", + "nodeType": "MemberAccess", + "referencedDeclaration": 63, + "src": "16989:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "16967:35:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$64_storage", + "typeString": "struct AllowanceModule.Delegate storage ref" + } + }, + "id": 1314, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "prev", + "nodeType": "MemberAccess", + "referencedDeclaration": 61, + "src": "16967:40:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "expression": { + "id": 1315, + "name": "current", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1174, + "src": "17010:7:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$64_memory_ptr", + "typeString": "struct AllowanceModule.Delegate memory" + } + }, + "id": 1316, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "prev", + "nodeType": "MemberAccess", + "referencedDeclaration": 61, + "src": "17010:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "src": "16967:55:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "id": 1318, + "nodeType": "ExpressionStatement", + "src": "16967:55:0" + } + ] + } + }, + { + "expression": { + "id": 1330, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "delete", + "prefix": true, + "src": "17042:46:0", + "subExpression": { + "baseExpression": { + "baseExpression": { + "id": 1321, + "name": "delegates", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 57, + "src": "17049:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_uint48_$_t_struct$_Delegate_$64_storage_$_$", + "typeString": "mapping(address => mapping(uint48 => struct AllowanceModule.Delegate storage ref))" + } + }, + "id": 1324, + "indexExpression": { + "expression": { + "id": 1322, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "17059:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1323, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "17059:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "17049:21:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint48_$_t_struct$_Delegate_$64_storage_$", + "typeString": "mapping(uint48 => struct AllowanceModule.Delegate storage ref)" + } + }, + "id": 1329, + "indexExpression": { + "arguments": [ + { + "id": 1327, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1168, + "src": "17078:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 1326, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "17071:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint48_$", + "typeString": "type(uint48)" + }, + "typeName": { + "id": 1325, + "name": "uint48", + "nodeType": "ElementaryTypeName", + "src": "17071:6:0", + "typeDescriptions": {} + } + }, + "id": 1328, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "17071:16:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "17049:39:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$64_storage", + "typeString": "struct AllowanceModule.Delegate storage ref" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1331, + "nodeType": "ExpressionStatement", + "src": "17042:46:0" + }, + { + "eventCall": { + "arguments": [ + { + "expression": { + "id": 1333, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "17118:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1334, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "17118:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "id": 1335, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1168, + "src": "17130:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 1332, + "name": "RemoveDelegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 87, + "src": "17103:14:0", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$returns$__$", + "typeString": "function (address,address)" + } + }, + "id": 1336, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "17103:36:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1337, + "nodeType": "EmitStatement", + "src": "17098:41:0" + } + ] + }, + "documentation": { + "id": 1166, + "nodeType": "StructuredDocumentation", + "src": "15459:317:0", + "text": "@dev Allows to remove a delegate.\n @param delegate Delegate that should be removed.\n @param removeAllowances Indicator if allowances should also be removed. This should be set to `true` unless this causes an out of gas, in this case the allowances should be \"manually\" deleted via `deleteAllowance`." + }, + "functionSelector": "dd43a79f", + "id": 1339, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "removeDelegate", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1171, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1168, + "mutability": "mutable", + "name": "delegate", + "nodeType": "VariableDeclaration", + "scope": 1339, + "src": "15805:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1167, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "15805:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1170, + "mutability": "mutable", + "name": "removeAllowances", + "nodeType": "VariableDeclaration", + "scope": 1339, + "src": "15823:21:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 1169, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "15823:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "15804:41:0" + }, + "returnParameters": { + "id": 1172, + "nodeType": "ParameterList", + "parameters": [], + "src": "15853:0:0" + }, + "scope": 1428, + "src": "15781:1365:0", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "public" + }, + { + "body": { + "id": 1426, + "nodeType": "Block", + "src": "17278:633:0", + "statements": [ + { + "expression": { + "id": 1359, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 1353, + "name": "results", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1349, + "src": "17288:7:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "id": 1357, + "name": "pageSize", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1345, + "src": "17312:8:0", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + ], + "id": 1356, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "NewExpression", + "src": "17298:13:0", + "typeDescriptions": { + "typeIdentifier": "t_function_objectcreation_pure$_t_uint256_$returns$_t_array$_t_address_$dyn_memory_ptr_$", + "typeString": "function (uint256) pure returns (address[] memory)" + }, + "typeName": { + "baseType": { + "id": 1354, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "17302:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 1355, + "nodeType": "ArrayTypeName", + "src": "17302:9:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + } + } + }, + "id": 1358, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "17298:23:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + "src": "17288:33:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + "id": 1360, + "nodeType": "ExpressionStatement", + "src": "17288:33:0" + }, + { + "assignments": [ + 1362 + ], + "declarations": [ + { + "constant": false, + "id": 1362, + "mutability": "mutable", + "name": "i", + "nodeType": "VariableDeclaration", + "scope": 1426, + "src": "17331:7:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "typeName": { + "id": 1361, + "name": "uint8", + "nodeType": "ElementaryTypeName", + "src": "17331:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "visibility": "internal" + } + ], + "id": 1364, + "initialValue": { + "hexValue": "30", + "id": 1363, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "17341:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "nodeType": "VariableDeclarationStatement", + "src": "17331:11:0" + }, + { + "assignments": [ + 1366 + ], + "declarations": [ + { + "constant": false, + "id": 1366, + "mutability": "mutable", + "name": "initialIndex", + "nodeType": "VariableDeclaration", + "scope": 1426, + "src": "17352:19:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + }, + "typeName": { + "id": 1365, + "name": "uint48", + "nodeType": "ElementaryTypeName", + "src": "17352:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "visibility": "internal" + } + ], + "id": 1376, + "initialValue": { + "condition": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + }, + "id": 1369, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 1367, + "name": "start", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1343, + "src": "17375:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "hexValue": "30", + "id": 1368, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "17384:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "17375:10:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "id": 1370, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "17374:12:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseExpression": { + "baseExpression": { + "id": 1372, + "name": "delegatesStart", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 51, + "src": "17397:14:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint48_$", + "typeString": "mapping(address => uint48)" + } + }, + "id": 1374, + "indexExpression": { + "id": 1373, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1341, + "src": "17412:4:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "17397:20:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "id": 1375, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "Conditional", + "src": "17374:43:0", + "trueExpression": { + "id": 1371, + "name": "start", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1343, + "src": "17389:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "17352:65:0" + }, + { + "assignments": [ + 1378 + ], + "declarations": [ + { + "constant": false, + "id": 1378, + "mutability": "mutable", + "name": "current", + "nodeType": "VariableDeclaration", + "scope": 1426, + "src": "17427:23:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$64_memory_ptr", + "typeString": "struct AllowanceModule.Delegate" + }, + "typeName": { + "id": 1377, + "name": "Delegate", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 64, + "src": "17427:8:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$64_storage_ptr", + "typeString": "struct AllowanceModule.Delegate" + } + }, + "visibility": "internal" + } + ], + "id": 1384, + "initialValue": { + "baseExpression": { + "baseExpression": { + "id": 1379, + "name": "delegates", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 57, + "src": "17453:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_uint48_$_t_struct$_Delegate_$64_storage_$_$", + "typeString": "mapping(address => mapping(uint48 => struct AllowanceModule.Delegate storage ref))" + } + }, + "id": 1381, + "indexExpression": { + "id": 1380, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1341, + "src": "17463:4:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "17453:15:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint48_$_t_struct$_Delegate_$64_storage_$", + "typeString": "mapping(uint48 => struct AllowanceModule.Delegate storage ref)" + } + }, + "id": 1383, + "indexExpression": { + "id": 1382, + "name": "initialIndex", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1366, + "src": "17469:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "17453:29:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$64_storage", + "typeString": "struct AllowanceModule.Delegate storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "17427:55:0" + }, + { + "body": { + "id": 1415, + "nodeType": "Block", + "src": "17546:124:0", + "statements": [ + { + "expression": { + "id": 1401, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "baseExpression": { + "id": 1396, + "name": "results", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1349, + "src": "17560:7:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + "id": 1398, + "indexExpression": { + "id": 1397, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1362, + "src": "17568:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "17560:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "expression": { + "id": 1399, + "name": "current", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1378, + "src": "17573:7:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$64_memory_ptr", + "typeString": "struct AllowanceModule.Delegate memory" + } + }, + "id": 1400, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "delegate", + "nodeType": "MemberAccess", + "referencedDeclaration": 59, + "src": "17573:16:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "17560:29:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 1402, + "nodeType": "ExpressionStatement", + "src": "17560:29:0" + }, + { + "expression": { + "id": 1404, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "17603:3:0", + "subExpression": { + "id": 1403, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1362, + "src": "17603:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "id": 1405, + "nodeType": "ExpressionStatement", + "src": "17603:3:0" + }, + { + "expression": { + "id": 1413, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 1406, + "name": "current", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1378, + "src": "17620:7:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$64_memory_ptr", + "typeString": "struct AllowanceModule.Delegate memory" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "baseExpression": { + "baseExpression": { + "id": 1407, + "name": "delegates", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 57, + "src": "17630:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_uint48_$_t_struct$_Delegate_$64_storage_$_$", + "typeString": "mapping(address => mapping(uint48 => struct AllowanceModule.Delegate storage ref))" + } + }, + "id": 1409, + "indexExpression": { + "id": 1408, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1341, + "src": "17640:4:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "17630:15:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint48_$_t_struct$_Delegate_$64_storage_$", + "typeString": "mapping(uint48 => struct AllowanceModule.Delegate storage ref)" + } + }, + "id": 1412, + "indexExpression": { + "expression": { + "id": 1410, + "name": "current", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1378, + "src": "17646:7:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$64_memory_ptr", + "typeString": "struct AllowanceModule.Delegate memory" + } + }, + "id": 1411, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "next", + "nodeType": "MemberAccess", + "referencedDeclaration": 63, + "src": "17646:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "17630:29:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$64_storage", + "typeString": "struct AllowanceModule.Delegate storage ref" + } + }, + "src": "17620:39:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$64_memory_ptr", + "typeString": "struct AllowanceModule.Delegate memory" + } + }, + "id": 1414, + "nodeType": "ExpressionStatement", + "src": "17620:39:0" + } + ] + }, + "condition": { + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 1395, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 1391, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 1385, + "name": "current", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1378, + "src": "17498:7:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$64_memory_ptr", + "typeString": "struct AllowanceModule.Delegate memory" + } + }, + "id": 1386, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "delegate", + "nodeType": "MemberAccess", + "referencedDeclaration": 59, + "src": "17498:16:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "arguments": [ + { + "hexValue": "30", + "id": 1389, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "17526:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 1388, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "17518:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 1387, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "17518:7:0", + "typeDescriptions": {} + } + }, + "id": 1390, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "17518:10:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "src": "17498:30:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "&&", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "id": 1394, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 1392, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1362, + "src": "17532:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "id": 1393, + "name": "pageSize", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1345, + "src": "17536:8:0", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "src": "17532:12:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "17498:46:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 1416, + "nodeType": "WhileStatement", + "src": "17492:178:0" + }, + { + "expression": { + "id": 1423, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 1417, + "name": "next", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1351, + "src": "17679:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "expression": { + "id": 1420, + "name": "current", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1378, + "src": "17693:7:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$64_memory_ptr", + "typeString": "struct AllowanceModule.Delegate memory" + } + }, + "id": 1421, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "delegate", + "nodeType": "MemberAccess", + "referencedDeclaration": 59, + "src": "17693:16:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 1419, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "17686:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint48_$", + "typeString": "type(uint48)" + }, + "typeName": { + "id": 1418, + "name": "uint48", + "nodeType": "ElementaryTypeName", + "src": "17686:6:0", + "typeDescriptions": {} + } + }, + "id": 1422, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "17686:24:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "src": "17679:31:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "id": 1424, + "nodeType": "ExpressionStatement", + "src": "17679:31:0" + }, + { + "AST": { + "nodeType": "YulBlock", + "src": "17863:42:0", + "statements": [ + { + "expression": { + "arguments": [ + { + "name": "results", + "nodeType": "YulIdentifier", + "src": "17884:7:0" + }, + { + "name": "i", + "nodeType": "YulIdentifier", + "src": "17893:1:0" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "17877:6:0" + }, + "nodeType": "YulFunctionCall", + "src": "17877:18:0" + }, + "nodeType": "YulExpressionStatement", + "src": "17877:18:0" + } + ] + }, + "evmVersion": "istanbul", + "externalReferences": [ + { + "declaration": 1362, + "isOffset": false, + "isSlot": false, + "src": "17893:1:0", + "valueSize": 1 + }, + { + "declaration": 1349, + "isOffset": false, + "isSlot": false, + "src": "17884:7:0", + "valueSize": 1 + } + ], + "id": 1425, + "nodeType": "InlineAssembly", + "src": "17854:51:0" + } + ] + }, + "functionSelector": "eb37abe0", + "id": 1427, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getDelegates", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1346, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1341, + "mutability": "mutable", + "name": "safe", + "nodeType": "VariableDeclaration", + "scope": 1427, + "src": "17174:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1340, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "17174:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1343, + "mutability": "mutable", + "name": "start", + "nodeType": "VariableDeclaration", + "scope": 1427, + "src": "17188:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + }, + "typeName": { + "id": 1342, + "name": "uint48", + "nodeType": "ElementaryTypeName", + "src": "17188:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1345, + "mutability": "mutable", + "name": "pageSize", + "nodeType": "VariableDeclaration", + "scope": 1427, + "src": "17202:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "typeName": { + "id": 1344, + "name": "uint8", + "nodeType": "ElementaryTypeName", + "src": "17202:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "visibility": "internal" + } + ], + "src": "17173:44:0" + }, + "returnParameters": { + "id": 1352, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1349, + "mutability": "mutable", + "name": "results", + "nodeType": "VariableDeclaration", + "scope": 1427, + "src": "17239:24:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[]" + }, + "typeName": { + "baseType": { + "id": 1347, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "17239:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 1348, + "nodeType": "ArrayTypeName", + "src": "17239:9:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1351, + "mutability": "mutable", + "name": "next", + "nodeType": "VariableDeclaration", + "scope": 1427, + "src": "17265:11:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + }, + "typeName": { + "id": 1350, + "name": "uint48", + "nodeType": "ElementaryTypeName", + "src": "17265:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "visibility": "internal" + } + ], + "src": "17238:39:0" + }, + "scope": 1428, + "src": "17152:759:0", + "stateMutability": "view", + "virtual": false, + "visibility": "public" + } + ], + "scope": 1429, + "src": "648:17265:0" + } + ], + "src": "42:17871:0" + }, + "legacyAST": { + "absolutePath": "/home/fer/repos/protofire/gnosis/safe-modules/allowances/contracts/AlowanceModule.sol", + "exportedSymbols": { + "AllowanceModule": [ + 1428 + ], + "GnosisSafe": [ + 18 + ] + }, + "id": 1429, + "license": "LGPL-3.0-only", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 1, + "literals": [ + "solidity", + ">=", + "0.7", + ".0", + "<", + "0.8", + ".0" + ], + "nodeType": "PragmaDirective", + "src": "42:31:0" + }, + { + "absolutePath": "/home/fer/repos/protofire/gnosis/safe-modules/allowances/contracts/Enum.sol", + "file": "./Enum.sol", + "id": 2, + "nodeType": "ImportDirective", + "scope": 1429, + "sourceUnit": 1436, + "src": "75:20:0", + "symbolAliases": [], + "unitAlias": "" + }, + { + "absolutePath": "/home/fer/repos/protofire/gnosis/safe-modules/allowances/contracts/SignatureDecoder.sol", + "file": "./SignatureDecoder.sol", + "id": 3, + "nodeType": "ImportDirective", + "scope": 1429, + "sourceUnit": 1552, + "src": "96:32:0", + "symbolAliases": [], + "unitAlias": "" + }, + { + "abstract": false, + "baseContracts": [], + "contractDependencies": [], + "contractKind": "interface", + "fullyImplemented": false, + "id": 18, + "linearizedBaseContracts": [ + 18 + ], + "name": "GnosisSafe", + "nodeType": "ContractDefinition", + "nodes": [ + { + "documentation": { + "id": 4, + "nodeType": "StructuredDocumentation", + "src": "157:325:0", + "text": "@dev Allows a Module to execute a Safe transaction without any further confirmations.\n @param to Destination address of module transaction.\n @param value Ether value of module transaction.\n @param data Data payload of module transaction.\n @param operation Operation type of module transaction." + }, + "functionSelector": "468721a7", + "id": 17, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "execTransactionFromModule", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 13, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 6, + "mutability": "mutable", + "name": "to", + "nodeType": "VariableDeclaration", + "scope": 17, + "src": "522:10:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 5, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "522:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 8, + "mutability": "mutable", + "name": "value", + "nodeType": "VariableDeclaration", + "scope": 17, + "src": "534:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 7, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "534:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 10, + "mutability": "mutable", + "name": "data", + "nodeType": "VariableDeclaration", + "scope": 17, + "src": "549:19:0", + "stateVariable": false, + "storageLocation": "calldata", + "typeDescriptions": { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 9, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "549:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 12, + "mutability": "mutable", + "name": "operation", + "nodeType": "VariableDeclaration", + "scope": 17, + "src": "570:24:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Operation_$1434", + "typeString": "enum Enum.Operation" + }, + "typeName": { + "id": 11, + "name": "Enum.Operation", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 1434, + "src": "570:14:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Operation_$1434", + "typeString": "enum Enum.Operation" + } + }, + "visibility": "internal" + } + ], + "src": "521:74:0" + }, + "returnParameters": { + "id": 16, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15, + "mutability": "mutable", + "name": "success", + "nodeType": "VariableDeclaration", + "scope": 17, + "src": "630:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 14, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "630:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "629:14:0" + }, + "scope": 18, + "src": "487:157:0", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + } + ], + "scope": 1429, + "src": "130:516:0" + }, + { + "abstract": false, + "baseContracts": [ + { + "baseName": { + "id": 19, + "name": "SignatureDecoder", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 1551, + "src": "676:16:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_SignatureDecoder_$1551", + "typeString": "contract SignatureDecoder" + } + }, + "id": 20, + "nodeType": "InheritanceSpecifier", + "src": "676:16:0" + } + ], + "contractDependencies": [ + 1551 + ], + "contractKind": "contract", + "fullyImplemented": true, + "id": 1428, + "linearizedBaseContracts": [ + 1428, + 1551 + ], + "name": "AllowanceModule", + "nodeType": "ContractDefinition", + "nodes": [ + { + "constant": true, + "functionSelector": "a3f4df7e", + "id": 23, + "mutability": "constant", + "name": "NAME", + "nodeType": "VariableDeclaration", + "scope": 1428, + "src": "700:48:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 21, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "700:6:0", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "value": { + "hexValue": "416c6c6f77616e6365204d6f64756c65", + "id": 22, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "730:18:0", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_08f58094bad74d8c1150a9739fed54fd2f5fa3e2ab1381a21213c5b33d83bad3", + "typeString": "literal_string \"Allowance Module\"" + }, + "value": "Allowance Module" + }, + "visibility": "public" + }, + { + "constant": true, + "functionSelector": "ffa1ad74", + "id": 26, + "mutability": "constant", + "name": "VERSION", + "nodeType": "VariableDeclaration", + "scope": 1428, + "src": "754:40:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 24, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "754:6:0", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "value": { + "hexValue": "302e312e30", + "id": 25, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "787:7:0", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_aa7cdbe2cce2ec7b606b0e199ddd9b264a6e645e767fb8479a7917dcd1b8693f", + "typeString": "literal_string \"0.1.0\"" + }, + "value": "0.1.0" + }, + "visibility": "public" + }, + { + "constant": true, + "functionSelector": "1db61b54", + "id": 29, + "mutability": "constant", + "name": "DOMAIN_SEPARATOR_TYPEHASH", + "nodeType": "VariableDeclaration", + "scope": 1428, + "src": "801:118:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 27, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "801:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": { + "hexValue": "307834376537393533346132343539353265386231363839336133333662383561336439656139666138633537336633643830336166623932613739343639323138", + "id": 28, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "853:66:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_32523383700587834770323112271211932718128200013265661849047136999858837557784_by_1", + "typeString": "int_const 3252...(69 digits omitted)...7784" + }, + "value": "0x47e79534a245952e8b16893a336b85a3d9ea9fa8c573f3d803afb92a79469218" + }, + "visibility": "public" + }, + { + "constant": true, + "functionSelector": "43abf5fe", + "id": 32, + "mutability": "constant", + "name": "ALLOWANCE_TRANSFER_TYPEHASH", + "nodeType": "VariableDeclaration", + "scope": 1428, + "src": "1023:120:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 30, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1023:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": { + "hexValue": "307838306230303632383039333230393465376363393635383633656235313138646330376535643237326336363730633461376338373239396530346663656562", + "id": 31, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1077:66:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_58207052191903435170300093819667864394893463916847536691962682627702085635819_by_1", + "typeString": "int_const 5820...(69 digits omitted)...5819" + }, + "value": "0x80b006280932094e7cc965863eb5118dc07e5d272c6670c4a7c87299e04fceeb" + }, + "visibility": "public" + }, + { + "constant": false, + "functionSelector": "b713c9d4", + "id": 40, + "mutability": "mutable", + "name": "allowances", + "nodeType": "VariableDeclaration", + "scope": 1428, + "src": "1337:88:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_mapping$_t_address_$_t_struct$_Allowance_$75_storage_$_$_$", + "typeString": "mapping(address => mapping(address => mapping(address => struct AllowanceModule.Allowance)))" + }, + "typeName": { + "id": 39, + "keyType": { + "id": 33, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1345:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "1337:70:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_mapping$_t_address_$_t_struct$_Allowance_$75_storage_$_$_$", + "typeString": "mapping(address => mapping(address => mapping(address => struct AllowanceModule.Allowance)))" + }, + "valueType": { + "id": 38, + "keyType": { + "id": 34, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1365:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "1356:50:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_struct$_Allowance_$75_storage_$_$", + "typeString": "mapping(address => mapping(address => struct AllowanceModule.Allowance))" + }, + "valueType": { + "id": 37, + "keyType": { + "id": 35, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1384:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "1376:29:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Allowance_$75_storage_$", + "typeString": "mapping(address => struct AllowanceModule.Allowance)" + }, + "valueType": { + "id": 36, + "name": "Allowance", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 75, + "src": "1395:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_storage_ptr", + "typeString": "struct AllowanceModule.Allowance" + } + } + } + } + }, + "visibility": "public" + }, + { + "constant": false, + "functionSelector": "f56e81fa", + "id": 47, + "mutability": "mutable", + "name": "tokens", + "nodeType": "VariableDeclaration", + "scope": 1428, + "src": "1465:64:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_array$_t_address_$dyn_storage_$_$", + "typeString": "mapping(address => mapping(address => address[]))" + }, + "typeName": { + "id": 46, + "keyType": { + "id": 41, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1473:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "1465:50:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_array$_t_address_$dyn_storage_$_$", + "typeString": "mapping(address => mapping(address => address[]))" + }, + "valueType": { + "id": 45, + "keyType": { + "id": 42, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1493:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "1484:30:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_array$_t_address_$dyn_storage_$", + "typeString": "mapping(address => address[])" + }, + "valueType": { + "baseType": { + "id": 43, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1504:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 44, + "nodeType": "ArrayTypeName", + "src": "1504:9:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + } + } + } + }, + "visibility": "public" + }, + { + "constant": false, + "functionSelector": "310a3bb1", + "id": 51, + "mutability": "mutable", + "name": "delegatesStart", + "nodeType": "VariableDeclaration", + "scope": 1428, + "src": "1592:48:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint48_$", + "typeString": "mapping(address => uint48)" + }, + "typeName": { + "id": 50, + "keyType": { + "id": 48, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1600:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "1592:26:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint48_$", + "typeString": "mapping(address => uint48)" + }, + "valueType": { + "id": 49, + "name": "uint48", + "nodeType": "ElementaryTypeName", + "src": "1611:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + } + }, + "visibility": "public" + }, + { + "constant": false, + "functionSelector": "ce60c692", + "id": 57, + "mutability": "mutable", + "name": "delegates", + "nodeType": "VariableDeclaration", + "scope": 1428, + "src": "1690:65:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_uint48_$_t_struct$_Delegate_$64_storage_$_$", + "typeString": "mapping(address => mapping(uint48 => struct AllowanceModule.Delegate))" + }, + "typeName": { + "id": 56, + "keyType": { + "id": 52, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1698:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "1690:48:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_uint48_$_t_struct$_Delegate_$64_storage_$_$", + "typeString": "mapping(address => mapping(uint48 => struct AllowanceModule.Delegate))" + }, + "valueType": { + "id": 55, + "keyType": { + "id": 53, + "name": "uint48", + "nodeType": "ElementaryTypeName", + "src": "1718:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "nodeType": "Mapping", + "src": "1709:28:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint48_$_t_struct$_Delegate_$64_storage_$", + "typeString": "mapping(uint48 => struct AllowanceModule.Delegate)" + }, + "valueType": { + "id": 54, + "name": "Delegate", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 64, + "src": "1728:8:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$64_storage_ptr", + "typeString": "struct AllowanceModule.Delegate" + } + } + } + }, + "visibility": "public" + }, + { + "canonicalName": "AllowanceModule.Delegate", + "id": 64, + "members": [ + { + "constant": false, + "id": 59, + "mutability": "mutable", + "name": "delegate", + "nodeType": "VariableDeclaration", + "scope": 64, + "src": "1964:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 58, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1964:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 61, + "mutability": "mutable", + "name": "prev", + "nodeType": "VariableDeclaration", + "scope": 64, + "src": "1990:11:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + }, + "typeName": { + "id": 60, + "name": "uint48", + "nodeType": "ElementaryTypeName", + "src": "1990:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 63, + "mutability": "mutable", + "name": "next", + "nodeType": "VariableDeclaration", + "scope": 64, + "src": "2011:11:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + }, + "typeName": { + "id": 62, + "name": "uint48", + "nodeType": "ElementaryTypeName", + "src": "2011:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "visibility": "internal" + } + ], + "name": "Delegate", + "nodeType": "StructDefinition", + "scope": 1428, + "src": "1938:91:0", + "visibility": "public" + }, + { + "canonicalName": "AllowanceModule.Allowance", + "id": 75, + "members": [ + { + "constant": false, + "id": 66, + "mutability": "mutable", + "name": "amount", + "nodeType": "VariableDeclaration", + "scope": 75, + "src": "2134:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "typeName": { + "id": 65, + "name": "uint96", + "nodeType": "ElementaryTypeName", + "src": "2134:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 68, + "mutability": "mutable", + "name": "spent", + "nodeType": "VariableDeclaration", + "scope": 75, + "src": "2157:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "typeName": { + "id": 67, + "name": "uint96", + "nodeType": "ElementaryTypeName", + "src": "2157:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 70, + "mutability": "mutable", + "name": "resetTimeMin", + "nodeType": "VariableDeclaration", + "scope": 75, + "src": "2179:19:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + }, + "typeName": { + "id": 69, + "name": "uint16", + "nodeType": "ElementaryTypeName", + "src": "2179:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 72, + "mutability": "mutable", + "name": "lastResetMin", + "nodeType": "VariableDeclaration", + "scope": 75, + "src": "2250:19:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 71, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "2250:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 74, + "mutability": "mutable", + "name": "nonce", + "nodeType": "VariableDeclaration", + "scope": 75, + "src": "2279:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + }, + "typeName": { + "id": 73, + "name": "uint16", + "nodeType": "ElementaryTypeName", + "src": "2279:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "visibility": "internal" + } + ], + "name": "Allowance", + "nodeType": "StructDefinition", + "scope": 1428, + "src": "2107:191:0", + "visibility": "public" + }, + { + "anonymous": false, + "id": 81, + "name": "AddDelegate", + "nodeType": "EventDefinition", + "parameters": { + "id": 80, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 77, + "indexed": true, + "mutability": "mutable", + "name": "safe", + "nodeType": "VariableDeclaration", + "scope": 81, + "src": "2322:20:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 76, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2322:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 79, + "indexed": false, + "mutability": "mutable", + "name": "delegate", + "nodeType": "VariableDeclaration", + "scope": 81, + "src": "2344:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 78, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2344:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "2321:40:0" + }, + "src": "2304:58:0" + }, + { + "anonymous": false, + "id": 87, + "name": "RemoveDelegate", + "nodeType": "EventDefinition", + "parameters": { + "id": 86, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 83, + "indexed": true, + "mutability": "mutable", + "name": "safe", + "nodeType": "VariableDeclaration", + "scope": 87, + "src": "2388:20:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 82, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2388:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 85, + "indexed": false, + "mutability": "mutable", + "name": "delegate", + "nodeType": "VariableDeclaration", + "scope": 87, + "src": "2410:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 84, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2410:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "2387:40:0" + }, + "src": "2367:61:0" + }, + { + "anonymous": false, + "id": 101, + "name": "ExecuteAllowanceTransfer", + "nodeType": "EventDefinition", + "parameters": { + "id": 100, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 89, + "indexed": true, + "mutability": "mutable", + "name": "safe", + "nodeType": "VariableDeclaration", + "scope": 101, + "src": "2464:20:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 88, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2464:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 91, + "indexed": false, + "mutability": "mutable", + "name": "delegate", + "nodeType": "VariableDeclaration", + "scope": 101, + "src": "2486:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 90, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2486:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 93, + "indexed": false, + "mutability": "mutable", + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 101, + "src": "2504:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 92, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2504:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 95, + "indexed": false, + "mutability": "mutable", + "name": "to", + "nodeType": "VariableDeclaration", + "scope": 101, + "src": "2519:10:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 94, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2519:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 97, + "indexed": false, + "mutability": "mutable", + "name": "value", + "nodeType": "VariableDeclaration", + "scope": 101, + "src": "2531:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "typeName": { + "id": 96, + "name": "uint96", + "nodeType": "ElementaryTypeName", + "src": "2531:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 99, + "indexed": false, + "mutability": "mutable", + "name": "nonce", + "nodeType": "VariableDeclaration", + "scope": 101, + "src": "2545:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + }, + "typeName": { + "id": 98, + "name": "uint16", + "nodeType": "ElementaryTypeName", + "src": "2545:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "visibility": "internal" + } + ], + "src": "2463:95:0" + }, + "src": "2433:126:0" + }, + { + "anonymous": false, + "id": 113, + "name": "PayAllowanceTransfer", + "nodeType": "EventDefinition", + "parameters": { + "id": 112, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 103, + "indexed": true, + "mutability": "mutable", + "name": "safe", + "nodeType": "VariableDeclaration", + "scope": 113, + "src": "2591:20:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 102, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2591:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 105, + "indexed": false, + "mutability": "mutable", + "name": "delegate", + "nodeType": "VariableDeclaration", + "scope": 113, + "src": "2613:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 104, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2613:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 107, + "indexed": false, + "mutability": "mutable", + "name": "paymentToken", + "nodeType": "VariableDeclaration", + "scope": 113, + "src": "2631:20:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 106, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2631:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 109, + "indexed": false, + "mutability": "mutable", + "name": "paymentReceiver", + "nodeType": "VariableDeclaration", + "scope": 113, + "src": "2653:23:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 108, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2653:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 111, + "indexed": false, + "mutability": "mutable", + "name": "payment", + "nodeType": "VariableDeclaration", + "scope": 113, + "src": "2678:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "typeName": { + "id": 110, + "name": "uint96", + "nodeType": "ElementaryTypeName", + "src": "2678:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "visibility": "internal" + } + ], + "src": "2590:103:0" + }, + "src": "2564:130:0" + }, + { + "anonymous": false, + "id": 125, + "name": "SetAllowance", + "nodeType": "EventDefinition", + "parameters": { + "id": 124, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 115, + "indexed": true, + "mutability": "mutable", + "name": "safe", + "nodeType": "VariableDeclaration", + "scope": 125, + "src": "2718:20:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 114, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2718:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 117, + "indexed": false, + "mutability": "mutable", + "name": "delegate", + "nodeType": "VariableDeclaration", + "scope": 125, + "src": "2740:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 116, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2740:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 119, + "indexed": false, + "mutability": "mutable", + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 125, + "src": "2758:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 118, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2758:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 121, + "indexed": false, + "mutability": "mutable", + "name": "allowanceAmount", + "nodeType": "VariableDeclaration", + "scope": 125, + "src": "2773:22:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "typeName": { + "id": 120, + "name": "uint96", + "nodeType": "ElementaryTypeName", + "src": "2773:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 123, + "indexed": false, + "mutability": "mutable", + "name": "resetTime", + "nodeType": "VariableDeclaration", + "scope": 125, + "src": "2797:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + }, + "typeName": { + "id": 122, + "name": "uint16", + "nodeType": "ElementaryTypeName", + "src": "2797:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "visibility": "internal" + } + ], + "src": "2717:97:0" + }, + "src": "2699:116:0" + }, + { + "anonymous": false, + "id": 133, + "name": "ResetAllowance", + "nodeType": "EventDefinition", + "parameters": { + "id": 132, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 127, + "indexed": true, + "mutability": "mutable", + "name": "safe", + "nodeType": "VariableDeclaration", + "scope": 133, + "src": "2841:20:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 126, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2841:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 129, + "indexed": false, + "mutability": "mutable", + "name": "delegate", + "nodeType": "VariableDeclaration", + "scope": 133, + "src": "2863:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 128, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2863:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 131, + "indexed": false, + "mutability": "mutable", + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 133, + "src": "2881:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 130, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2881:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "2840:55:0" + }, + "src": "2820:76:0" + }, + { + "anonymous": false, + "id": 141, + "name": "DeleteAllowance", + "nodeType": "EventDefinition", + "parameters": { + "id": 140, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 135, + "indexed": true, + "mutability": "mutable", + "name": "safe", + "nodeType": "VariableDeclaration", + "scope": 141, + "src": "2923:20:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 134, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2923:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 137, + "indexed": false, + "mutability": "mutable", + "name": "delegate", + "nodeType": "VariableDeclaration", + "scope": 141, + "src": "2945:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 136, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2945:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 139, + "indexed": false, + "mutability": "mutable", + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 141, + "src": "2963:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 138, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2963:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "2922:55:0" + }, + "src": "2901:77:0" + }, + { + "body": { + "id": 289, + "nodeType": "Block", + "src": "3570:1250:0", + "statements": [ + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 161, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 156, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 144, + "src": "3588:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "arguments": [ + { + "hexValue": "30", + "id": 159, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3608:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 158, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "3600:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 157, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3600:7:0", + "typeDescriptions": {} + } + }, + "id": 160, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3600:10:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "src": "3588:22:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "hexValue": "64656c656761746520213d2061646472657373283029", + "id": 162, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3612:24:0", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_47a766b6b1495cbb254fe5e4828ba3622b8f5a171138d82c6bfaf22ff04f26eb", + "typeString": "literal_string \"delegate != address(0)\"" + }, + "value": "delegate != address(0)" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_47a766b6b1495cbb254fe5e4828ba3622b8f5a171138d82c6bfaf22ff04f26eb", + "typeString": "literal_string \"delegate != address(0)\"" + } + ], + "id": 155, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "3580:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 163, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3580:57:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 164, + "nodeType": "ExpressionStatement", + "src": "3580:57:0" + }, + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 177, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "baseExpression": { + "baseExpression": { + "id": 166, + "name": "delegates", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 57, + "src": "3655:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_uint48_$_t_struct$_Delegate_$64_storage_$_$", + "typeString": "mapping(address => mapping(uint48 => struct AllowanceModule.Delegate storage ref))" + } + }, + "id": 169, + "indexExpression": { + "expression": { + "id": 167, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "3665:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 168, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "3665:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3655:21:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint48_$_t_struct$_Delegate_$64_storage_$", + "typeString": "mapping(uint48 => struct AllowanceModule.Delegate storage ref)" + } + }, + "id": 174, + "indexExpression": { + "arguments": [ + { + "id": 172, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 144, + "src": "3684:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 171, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "3677:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint48_$", + "typeString": "type(uint48)" + }, + "typeName": { + "id": 170, + "name": "uint48", + "nodeType": "ElementaryTypeName", + "src": "3677:6:0", + "typeDescriptions": {} + } + }, + "id": 173, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3677:16:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3655:39:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$64_storage", + "typeString": "struct AllowanceModule.Delegate storage ref" + } + }, + "id": 175, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "delegate", + "nodeType": "MemberAccess", + "referencedDeclaration": 59, + "src": "3655:48:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "id": 176, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 144, + "src": "3707:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "3655:60:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "hexValue": "64656c6567617465735b6d73672e73656e6465725d5b75696e7434382864656c6567617465295d2e64656c6567617465203d3d2064656c6567617465", + "id": 178, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3717:62:0", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_58537fa1960fbebccc117b6218b0af08a9f148039299593ea287e665dd534bb1", + "typeString": "literal_string \"delegates[msg.sender][uint48(delegate)].delegate == delegate\"" + }, + "value": "delegates[msg.sender][uint48(delegate)].delegate == delegate" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_58537fa1960fbebccc117b6218b0af08a9f148039299593ea287e665dd534bb1", + "typeString": "literal_string \"delegates[msg.sender][uint48(delegate)].delegate == delegate\"" + } + ], + "id": 165, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "3647:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 179, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3647:133:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 180, + "nodeType": "ExpressionStatement", + "src": "3647:133:0" + }, + { + "assignments": [ + 182 + ], + "declarations": [ + { + "constant": false, + "id": 182, + "mutability": "mutable", + "name": "allowance", + "nodeType": "VariableDeclaration", + "scope": 289, + "src": "3790:26:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance" + }, + "typeName": { + "id": 181, + "name": "Allowance", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 75, + "src": "3790:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_storage_ptr", + "typeString": "struct AllowanceModule.Allowance" + } + }, + "visibility": "internal" + } + ], + "id": 189, + "initialValue": { + "arguments": [ + { + "expression": { + "id": 184, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "3832:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 185, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "3832:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "id": 186, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 144, + "src": "3844:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 187, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 146, + "src": "3854:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 183, + "name": "getAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 360, + "src": "3819:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_address_$_t_address_$_t_address_$returns$_t_struct$_Allowance_$75_memory_ptr_$", + "typeString": "function (address,address,address) view returns (struct AllowanceModule.Allowance memory)" + } + }, + "id": 188, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3819:41:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "3790:70:0" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + }, + "id": 193, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 190, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 182, + "src": "3874:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 191, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "nonce", + "nodeType": "MemberAccess", + "referencedDeclaration": 74, + "src": "3874:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "30", + "id": 192, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3893:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "3874:20:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 211, + "nodeType": "IfStatement", + "src": "3870:210:0", + "trueBody": { + "id": 210, + "nodeType": "Block", + "src": "3896:184:0", + "statements": [ + { + "expression": { + "id": 198, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 194, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 182, + "src": "3996:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 196, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "nonce", + "nodeType": "MemberAccess", + "referencedDeclaration": 74, + "src": "3996:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "hexValue": "31", + "id": 197, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4014:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "3996:19:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "id": 199, + "nodeType": "ExpressionStatement", + "src": "3996:19:0" + }, + { + "expression": { + "arguments": [ + { + "id": 207, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 146, + "src": "4063:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "expression": { + "baseExpression": { + "baseExpression": { + "id": 200, + "name": "tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 47, + "src": "4029:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_array$_t_address_$dyn_storage_$_$", + "typeString": "mapping(address => mapping(address => address[] storage ref))" + } + }, + "id": 204, + "indexExpression": { + "expression": { + "id": 201, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "4036:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 202, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "4036:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "4029:18:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_array$_t_address_$dyn_storage_$", + "typeString": "mapping(address => address[] storage ref)" + } + }, + "id": 205, + "indexExpression": { + "id": 203, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 144, + "src": "4048:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "4029:28:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 206, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "push", + "nodeType": "MemberAccess", + "src": "4029:33:0", + "typeDescriptions": { + "typeIdentifier": "t_function_arraypush_nonpayable$_t_address_$returns$__$", + "typeString": "function (address)" + } + }, + "id": 208, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4029:40:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 209, + "nodeType": "ExpressionStatement", + "src": "4029:40:0" + } + ] + } + }, + { + "assignments": [ + 213 + ], + "declarations": [ + { + "constant": false, + "id": 213, + "mutability": "mutable", + "name": "currentMin", + "nodeType": "VariableDeclaration", + "scope": 289, + "src": "4206:17:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 212, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "4206:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + } + ], + "id": 221, + "initialValue": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 219, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 216, + "name": "block", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -4, + "src": "4233:5:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_block", + "typeString": "block" + } + }, + "id": 217, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "timestamp", + "nodeType": "MemberAccess", + "src": "4233:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "/", + "rightExpression": { + "hexValue": "3630", + "id": 218, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4251:2:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_60_by_1", + "typeString": "int_const 60" + }, + "value": "60" + }, + "src": "4233:20:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 215, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "4226:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint32_$", + "typeString": "type(uint32)" + }, + "typeName": { + "id": 214, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "4226:6:0", + "typeDescriptions": {} + } + }, + "id": 220, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4226:28:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "4206:48:0" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "id": 224, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 222, + "name": "resetBaseMin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 152, + "src": "4268:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "hexValue": "30", + "id": 223, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4283:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "4268:16:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "condition": { + "commonType": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "id": 250, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 247, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 182, + "src": "4482:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 248, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "lastResetMin", + "nodeType": "MemberAccess", + "referencedDeclaration": 72, + "src": "4482:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "30", + "id": 249, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4508:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "4482:27:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 258, + "nodeType": "IfStatement", + "src": "4478:93:0", + "trueBody": { + "id": 257, + "nodeType": "Block", + "src": "4511:60:0", + "statements": [ + { + "expression": { + "id": 255, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 251, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 182, + "src": "4525:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 253, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "lastResetMin", + "nodeType": "MemberAccess", + "referencedDeclaration": 72, + "src": "4525:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "id": 254, + "name": "currentMin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 213, + "src": "4550:10:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "src": "4525:35:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "id": 256, + "nodeType": "ExpressionStatement", + "src": "4525:35:0" + } + ] + } + }, + "id": 259, + "nodeType": "IfStatement", + "src": "4264:307:0", + "trueBody": { + "id": 246, + "nodeType": "Block", + "src": "4286:186:0", + "statements": [ + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "id": 228, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 226, + "name": "resetBaseMin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 152, + "src": "4308:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "id": 227, + "name": "currentMin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 213, + "src": "4324:10:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "src": "4308:26:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "hexValue": "7265736574426173654d696e203c3d2063757272656e744d696e", + "id": 229, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4336:28:0", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_1ede17760f99a36e22c97a9975aa792b767bce45958763871f51d908d7d840ba", + "typeString": "literal_string \"resetBaseMin <= currentMin\"" + }, + "value": "resetBaseMin <= currentMin" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_1ede17760f99a36e22c97a9975aa792b767bce45958763871f51d908d7d840ba", + "typeString": "literal_string \"resetBaseMin <= currentMin\"" + } + ], + "id": 225, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "4300:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 230, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4300:65:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 231, + "nodeType": "ExpressionStatement", + "src": "4300:65:0" + }, + { + "expression": { + "id": 244, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 232, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 182, + "src": "4379:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 234, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "lastResetMin", + "nodeType": "MemberAccess", + "referencedDeclaration": 72, + "src": "4379:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "commonType": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "id": 243, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 235, + "name": "currentMin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 213, + "src": "4404:10:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "id": 241, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "id": 238, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 236, + "name": "currentMin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 213, + "src": "4419:10:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "id": 237, + "name": "resetBaseMin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 152, + "src": "4432:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "src": "4419:25:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + } + ], + "id": 239, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "4418:27:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "BinaryOperation", + "operator": "%", + "rightExpression": { + "id": 240, + "name": "resetTimeMin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 150, + "src": "4448:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "src": "4418:42:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + } + ], + "id": 242, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "4417:44:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "src": "4404:57:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "src": "4379:82:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "id": 245, + "nodeType": "ExpressionStatement", + "src": "4379:82:0" + } + ] + } + }, + { + "expression": { + "id": 264, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 260, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 182, + "src": "4580:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 262, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "resetTimeMin", + "nodeType": "MemberAccess", + "referencedDeclaration": 70, + "src": "4580:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "id": 263, + "name": "resetTimeMin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 150, + "src": "4605:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "src": "4580:37:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "id": 265, + "nodeType": "ExpressionStatement", + "src": "4580:37:0" + }, + { + "expression": { + "id": 270, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 266, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 182, + "src": "4627:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 268, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "amount", + "nodeType": "MemberAccess", + "referencedDeclaration": 66, + "src": "4627:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "id": 269, + "name": "allowanceAmount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 148, + "src": "4646:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "src": "4627:34:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "id": 271, + "nodeType": "ExpressionStatement", + "src": "4627:34:0" + }, + { + "expression": { + "arguments": [ + { + "expression": { + "id": 273, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "4687:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 274, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "4687:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "id": 275, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 144, + "src": "4699:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 276, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 146, + "src": "4709:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 277, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 182, + "src": "4716:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + ], + "id": 272, + "name": "updateAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 382, + "src": "4671:15:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_address_$_t_struct$_Allowance_$75_memory_ptr_$returns$__$", + "typeString": "function (address,address,address,struct AllowanceModule.Allowance memory)" + } + }, + "id": 278, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4671:55:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 279, + "nodeType": "ExpressionStatement", + "src": "4671:55:0" + }, + { + "eventCall": { + "arguments": [ + { + "expression": { + "id": 281, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "4754:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 282, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "4754:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "id": 283, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 144, + "src": "4766:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 284, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 146, + "src": "4776:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 285, + "name": "allowanceAmount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 148, + "src": "4783:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + { + "id": 286, + "name": "resetTimeMin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 150, + "src": "4800:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + ], + "id": 280, + "name": "SetAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 125, + "src": "4741:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_address_$_t_uint96_$_t_uint16_$returns$__$", + "typeString": "function (address,address,address,uint96,uint16)" + } + }, + "id": 287, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4741:72:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 288, + "nodeType": "EmitStatement", + "src": "4736:77:0" + } + ] + }, + "documentation": { + "id": 142, + "nodeType": "StructuredDocumentation", + "src": "2984:441:0", + "text": "@dev Allows to update the allowance for a specified token. This can only be done via a Safe transaction.\n @param delegate Delegate whose allowance should be updated.\n @param token Token contract address.\n @param allowanceAmount allowance in smallest token unit.\n @param resetTimeMin Time after which the allowance should reset\n @param resetBaseMin Time based on which the reset time should be increased" + }, + "functionSelector": "beaeb388", + "id": 290, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "setAllowance", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 153, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 144, + "mutability": "mutable", + "name": "delegate", + "nodeType": "VariableDeclaration", + "scope": 290, + "src": "3452:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 143, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3452:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 146, + "mutability": "mutable", + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 290, + "src": "3470:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 145, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3470:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 148, + "mutability": "mutable", + "name": "allowanceAmount", + "nodeType": "VariableDeclaration", + "scope": 290, + "src": "3485:22:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "typeName": { + "id": 147, + "name": "uint96", + "nodeType": "ElementaryTypeName", + "src": "3485:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 150, + "mutability": "mutable", + "name": "resetTimeMin", + "nodeType": "VariableDeclaration", + "scope": 290, + "src": "3509:19:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + }, + "typeName": { + "id": 149, + "name": "uint16", + "nodeType": "ElementaryTypeName", + "src": "3509:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 152, + "mutability": "mutable", + "name": "resetBaseMin", + "nodeType": "VariableDeclaration", + "scope": 290, + "src": "3530:19:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 151, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "3530:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + } + ], + "src": "3451:99:0" + }, + "returnParameters": { + "id": 154, + "nodeType": "ParameterList", + "parameters": [], + "src": "3570:0:0" + }, + "scope": 1428, + "src": "3430:1390:0", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "public" + }, + { + "body": { + "id": 359, + "nodeType": "Block", + "src": "4945:667:0", + "statements": [ + { + "expression": { + "id": 309, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 301, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 299, + "src": "4955:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "baseExpression": { + "baseExpression": { + "baseExpression": { + "id": 302, + "name": "allowances", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 40, + "src": "4967:10:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_mapping$_t_address_$_t_struct$_Allowance_$75_storage_$_$_$", + "typeString": "mapping(address => mapping(address => mapping(address => struct AllowanceModule.Allowance storage ref)))" + } + }, + "id": 304, + "indexExpression": { + "id": 303, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 292, + "src": "4978:4:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "4967:16:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_struct$_Allowance_$75_storage_$_$", + "typeString": "mapping(address => mapping(address => struct AllowanceModule.Allowance storage ref))" + } + }, + "id": 306, + "indexExpression": { + "id": 305, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 294, + "src": "4984:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "4967:26:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Allowance_$75_storage_$", + "typeString": "mapping(address => struct AllowanceModule.Allowance storage ref)" + } + }, + "id": 308, + "indexExpression": { + "id": 307, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 296, + "src": "4994:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "4967:33:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_storage", + "typeString": "struct AllowanceModule.Allowance storage ref" + } + }, + "src": "4955:45:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 310, + "nodeType": "ExpressionStatement", + "src": "4955:45:0" + }, + { + "assignments": [ + 312 + ], + "declarations": [ + { + "constant": false, + "id": 312, + "mutability": "mutable", + "name": "currentMin", + "nodeType": "VariableDeclaration", + "scope": 359, + "src": "5072:17:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 311, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "5072:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + } + ], + "id": 320, + "initialValue": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 318, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 315, + "name": "block", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -4, + "src": "5099:5:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_block", + "typeString": "block" + } + }, + "id": 316, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "timestamp", + "nodeType": "MemberAccess", + "src": "5099:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "/", + "rightExpression": { + "hexValue": "3630", + "id": 317, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "5117:2:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_60_by_1", + "typeString": "int_const 60" + }, + "value": "60" + }, + "src": "5099:20:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 314, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "5092:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint32_$", + "typeString": "type(uint32)" + }, + "typeName": { + "id": 313, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "5092:6:0", + "typeDescriptions": {} + } + }, + "id": 319, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5092:28:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "5072:48:0" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 332, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "commonType": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + }, + "id": 324, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 321, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 299, + "src": "5232:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 322, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "resetTimeMin", + "nodeType": "MemberAccess", + "referencedDeclaration": 70, + "src": "5232:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "hexValue": "30", + "id": 323, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "5257:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "5232:26:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "&&", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "id": 331, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 325, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 299, + "src": "5262:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 326, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "lastResetMin", + "nodeType": "MemberAccess", + "referencedDeclaration": 72, + "src": "5262:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "id": 330, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 327, + "name": "currentMin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 312, + "src": "5288:10:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "expression": { + "id": 328, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 299, + "src": "5301:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 329, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "resetTimeMin", + "nodeType": "MemberAccess", + "referencedDeclaration": 70, + "src": "5301:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "src": "5288:35:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "src": "5262:61:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "5232:91:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 356, + "nodeType": "IfStatement", + "src": "5228:352:0", + "trueBody": { + "id": 355, + "nodeType": "Block", + "src": "5325:255:0", + "statements": [ + { + "expression": { + "id": 337, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 333, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 299, + "src": "5339:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 335, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "spent", + "nodeType": "MemberAccess", + "referencedDeclaration": 68, + "src": "5339:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "hexValue": "30", + "id": 336, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "5357:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "5339:19:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "id": 338, + "nodeType": "ExpressionStatement", + "src": "5339:19:0" + }, + { + "expression": { + "id": 353, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 339, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 299, + "src": "5467:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 341, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "lastResetMin", + "nodeType": "MemberAccess", + "referencedDeclaration": 72, + "src": "5467:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "commonType": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "id": 352, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 342, + "name": "currentMin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 312, + "src": "5492:10:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "id": 350, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "id": 346, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 343, + "name": "currentMin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 312, + "src": "5507:10:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "expression": { + "id": 344, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 299, + "src": "5520:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 345, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "lastResetMin", + "nodeType": "MemberAccess", + "referencedDeclaration": 72, + "src": "5520:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "src": "5507:35:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + } + ], + "id": 347, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "5506:37:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "BinaryOperation", + "operator": "%", + "rightExpression": { + "expression": { + "id": 348, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 299, + "src": "5546:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 349, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "resetTimeMin", + "nodeType": "MemberAccess", + "referencedDeclaration": 70, + "src": "5546:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "src": "5506:62:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + } + ], + "id": 351, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "5505:64:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "src": "5492:77:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "src": "5467:102:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "id": 354, + "nodeType": "ExpressionStatement", + "src": "5467:102:0" + } + ] + } + }, + { + "expression": { + "id": 357, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 299, + "src": "5596:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "functionReturnParameters": 300, + "id": 358, + "nodeType": "Return", + "src": "5589:16:0" + } + ] + }, + "id": 360, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getAllowance", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 297, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 292, + "mutability": "mutable", + "name": "safe", + "nodeType": "VariableDeclaration", + "scope": 360, + "src": "4848:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 291, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4848:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 294, + "mutability": "mutable", + "name": "delegate", + "nodeType": "VariableDeclaration", + "scope": 360, + "src": "4862:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 293, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4862:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 296, + "mutability": "mutable", + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 360, + "src": "4880:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 295, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4880:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "4847:47:0" + }, + "returnParameters": { + "id": 300, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 299, + "mutability": "mutable", + "name": "allowance", + "nodeType": "VariableDeclaration", + "scope": 360, + "src": "4917:26:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance" + }, + "typeName": { + "id": 298, + "name": "Allowance", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 75, + "src": "4917:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_storage_ptr", + "typeString": "struct AllowanceModule.Allowance" + } + }, + "visibility": "internal" + } + ], + "src": "4916:28:0" + }, + "scope": 1428, + "src": "4826:786:0", + "stateMutability": "view", + "virtual": false, + "visibility": "private" + }, + { + "body": { + "id": 381, + "nodeType": "Block", + "src": "5726:62:0", + "statements": [ + { + "expression": { + "id": 379, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "baseExpression": { + "baseExpression": { + "baseExpression": { + "id": 371, + "name": "allowances", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 40, + "src": "5736:10:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_mapping$_t_address_$_t_struct$_Allowance_$75_storage_$_$_$", + "typeString": "mapping(address => mapping(address => mapping(address => struct AllowanceModule.Allowance storage ref)))" + } + }, + "id": 375, + "indexExpression": { + "id": 372, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 362, + "src": "5747:4:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "5736:16:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_struct$_Allowance_$75_storage_$_$", + "typeString": "mapping(address => mapping(address => struct AllowanceModule.Allowance storage ref))" + } + }, + "id": 376, + "indexExpression": { + "id": 373, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 364, + "src": "5753:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "5736:26:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Allowance_$75_storage_$", + "typeString": "mapping(address => struct AllowanceModule.Allowance storage ref)" + } + }, + "id": 377, + "indexExpression": { + "id": 374, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 366, + "src": "5763:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "5736:33:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_storage", + "typeString": "struct AllowanceModule.Allowance storage ref" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "id": 378, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 368, + "src": "5772:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "src": "5736:45:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_storage", + "typeString": "struct AllowanceModule.Allowance storage ref" + } + }, + "id": 380, + "nodeType": "ExpressionStatement", + "src": "5736:45:0" + } + ] + }, + "id": 382, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "updateAllowance", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 369, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 362, + "mutability": "mutable", + "name": "safe", + "nodeType": "VariableDeclaration", + "scope": 382, + "src": "5643:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 361, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5643:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 364, + "mutability": "mutable", + "name": "delegate", + "nodeType": "VariableDeclaration", + "scope": 382, + "src": "5657:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 363, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5657:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 366, + "mutability": "mutable", + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 382, + "src": "5675:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 365, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5675:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 368, + "mutability": "mutable", + "name": "allowance", + "nodeType": "VariableDeclaration", + "scope": 382, + "src": "5690:26:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance" + }, + "typeName": { + "id": 367, + "name": "Allowance", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 75, + "src": "5690:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_storage_ptr", + "typeString": "struct AllowanceModule.Allowance" + } + }, + "visibility": "internal" + } + ], + "src": "5642:75:0" + }, + "returnParameters": { + "id": 370, + "nodeType": "ParameterList", + "parameters": [], + "src": "5726:0:0" + }, + "scope": 1428, + "src": "5618:170:0", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "private" + }, + { + "body": { + "id": 420, + "nodeType": "Block", + "src": "6049:239:0", + "statements": [ + { + "assignments": [ + 391 + ], + "declarations": [ + { + "constant": false, + "id": 391, + "mutability": "mutable", + "name": "allowance", + "nodeType": "VariableDeclaration", + "scope": 420, + "src": "6059:26:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance" + }, + "typeName": { + "id": 390, + "name": "Allowance", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 75, + "src": "6059:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_storage_ptr", + "typeString": "struct AllowanceModule.Allowance" + } + }, + "visibility": "internal" + } + ], + "id": 398, + "initialValue": { + "arguments": [ + { + "expression": { + "id": 393, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "6101:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 394, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "6101:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "id": 395, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 385, + "src": "6113:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 396, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 387, + "src": "6123:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 392, + "name": "getAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 360, + "src": "6088:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_address_$_t_address_$_t_address_$returns$_t_struct$_Allowance_$75_memory_ptr_$", + "typeString": "function (address,address,address) view returns (struct AllowanceModule.Allowance memory)" + } + }, + "id": 397, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6088:41:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "6059:70:0" + }, + { + "expression": { + "id": 403, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 399, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 391, + "src": "6139:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 401, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "spent", + "nodeType": "MemberAccess", + "referencedDeclaration": 68, + "src": "6139:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "hexValue": "30", + "id": 402, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6157:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "6139:19:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "id": 404, + "nodeType": "ExpressionStatement", + "src": "6139:19:0" + }, + { + "expression": { + "arguments": [ + { + "expression": { + "id": 406, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "6184:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 407, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "6184:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "id": 408, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 385, + "src": "6196:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 409, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 387, + "src": "6206:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 410, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 391, + "src": "6213:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + ], + "id": 405, + "name": "updateAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 382, + "src": "6168:15:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_address_$_t_struct$_Allowance_$75_memory_ptr_$returns$__$", + "typeString": "function (address,address,address,struct AllowanceModule.Allowance memory)" + } + }, + "id": 411, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6168:55:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 412, + "nodeType": "ExpressionStatement", + "src": "6168:55:0" + }, + { + "eventCall": { + "arguments": [ + { + "expression": { + "id": 414, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "6253:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 415, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "6253:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "id": 416, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 385, + "src": "6265:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 417, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 387, + "src": "6275:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 413, + "name": "ResetAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 133, + "src": "6238:14:0", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_address_$returns$__$", + "typeString": "function (address,address,address)" + } + }, + "id": 418, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6238:43:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 419, + "nodeType": "EmitStatement", + "src": "6233:48:0" + } + ] + }, + "documentation": { + "id": 383, + "nodeType": "StructuredDocumentation", + "src": "5794:186:0", + "text": "@dev Allows to reset the allowance for a specific delegate and token.\n @param delegate Delegate whose allowance should be updated.\n @param token Token contract address." + }, + "functionSelector": "c19bf50e", + "id": 421, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "resetAllowance", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 388, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 385, + "mutability": "mutable", + "name": "delegate", + "nodeType": "VariableDeclaration", + "scope": 421, + "src": "6009:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 384, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6009:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 387, + "mutability": "mutable", + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 421, + "src": "6027:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 386, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6027:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "6008:33:0" + }, + "returnParameters": { + "id": 389, + "nodeType": "ParameterList", + "parameters": [], + "src": "6049:0:0" + }, + "scope": 1428, + "src": "5985:303:0", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "public" + }, + { + "body": { + "id": 477, + "nodeType": "Block", + "src": "6613:342:0", + "statements": [ + { + "assignments": [ + 430 + ], + "declarations": [ + { + "constant": false, + "id": 430, + "mutability": "mutable", + "name": "allowance", + "nodeType": "VariableDeclaration", + "scope": 477, + "src": "6623:26:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance" + }, + "typeName": { + "id": 429, + "name": "Allowance", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 75, + "src": "6623:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_storage_ptr", + "typeString": "struct AllowanceModule.Allowance" + } + }, + "visibility": "internal" + } + ], + "id": 437, + "initialValue": { + "arguments": [ + { + "expression": { + "id": 432, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "6665:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 433, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "6665:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "id": 434, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 424, + "src": "6677:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 435, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 426, + "src": "6687:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 431, + "name": "getAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 360, + "src": "6652:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_address_$_t_address_$_t_address_$returns$_t_struct$_Allowance_$75_memory_ptr_$", + "typeString": "function (address,address,address) view returns (struct AllowanceModule.Allowance memory)" + } + }, + "id": 436, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6652:41:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "6623:70:0" + }, + { + "expression": { + "id": 442, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 438, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 430, + "src": "6703:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 440, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "amount", + "nodeType": "MemberAccess", + "referencedDeclaration": 66, + "src": "6703:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "hexValue": "30", + "id": 441, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6722:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "6703:20:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "id": 443, + "nodeType": "ExpressionStatement", + "src": "6703:20:0" + }, + { + "expression": { + "id": 448, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 444, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 430, + "src": "6733:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 446, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "spent", + "nodeType": "MemberAccess", + "referencedDeclaration": 68, + "src": "6733:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "hexValue": "30", + "id": 447, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6751:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "6733:19:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "id": 449, + "nodeType": "ExpressionStatement", + "src": "6733:19:0" + }, + { + "expression": { + "id": 454, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 450, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 430, + "src": "6762:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 452, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "resetTimeMin", + "nodeType": "MemberAccess", + "referencedDeclaration": 70, + "src": "6762:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "hexValue": "30", + "id": 453, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6787:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "6762:26:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "id": 455, + "nodeType": "ExpressionStatement", + "src": "6762:26:0" + }, + { + "expression": { + "id": 460, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 456, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 430, + "src": "6798:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 458, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "lastResetMin", + "nodeType": "MemberAccess", + "referencedDeclaration": 72, + "src": "6798:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "hexValue": "30", + "id": 459, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6823:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "6798:26:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "id": 461, + "nodeType": "ExpressionStatement", + "src": "6798:26:0" + }, + { + "expression": { + "arguments": [ + { + "expression": { + "id": 463, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "6850:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 464, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "6850:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "id": 465, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 424, + "src": "6862:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 466, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 426, + "src": "6872:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 467, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 430, + "src": "6879:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + ], + "id": 462, + "name": "updateAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 382, + "src": "6834:15:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_address_$_t_struct$_Allowance_$75_memory_ptr_$returns$__$", + "typeString": "function (address,address,address,struct AllowanceModule.Allowance memory)" + } + }, + "id": 468, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6834:55:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 469, + "nodeType": "ExpressionStatement", + "src": "6834:55:0" + }, + { + "eventCall": { + "arguments": [ + { + "expression": { + "id": 471, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "6920:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 472, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "6920:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "id": 473, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 424, + "src": "6932:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 474, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 426, + "src": "6942:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 470, + "name": "DeleteAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 141, + "src": "6904:15:0", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_address_$returns$__$", + "typeString": "function (address,address,address)" + } + }, + "id": 475, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6904:44:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 476, + "nodeType": "EmitStatement", + "src": "6899:49:0" + } + ] + }, + "documentation": { + "id": 422, + "nodeType": "StructuredDocumentation", + "src": "6294:237:0", + "text": "@dev Allows to remove the allowance for a specific delegate and token. This will set all values except the `nonce` to 0.\n @param delegate Delegate whose allowance should be updated.\n @param token Token contract address." + }, + "functionSelector": "885133e3", + "id": 478, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "deleteAllowance", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 427, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 424, + "mutability": "mutable", + "name": "delegate", + "nodeType": "VariableDeclaration", + "scope": 478, + "src": "6561:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 423, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6561:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 426, + "mutability": "mutable", + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 478, + "src": "6579:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 425, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6579:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "6560:33:0" + }, + "returnParameters": { + "id": 428, + "nodeType": "ParameterList", + "parameters": [], + "src": "6613:0:0" + }, + "scope": 1428, + "src": "6536:419:0", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "public" + }, + { + "body": { + "id": 685, + "nodeType": "Block", + "src": "7828:2095:0", + "statements": [ + { + "assignments": [ + 499 + ], + "declarations": [ + { + "constant": false, + "id": 499, + "mutability": "mutable", + "name": "allowance", + "nodeType": "VariableDeclaration", + "scope": 685, + "src": "7867:26:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance" + }, + "typeName": { + "id": 498, + "name": "Allowance", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 75, + "src": "7867:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_storage_ptr", + "typeString": "struct AllowanceModule.Allowance" + } + }, + "visibility": "internal" + } + ], + "id": 508, + "initialValue": { + "arguments": [ + { + "arguments": [ + { + "id": 503, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 481, + "src": "7917:4:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + ], + "id": 502, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "7909:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 501, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "7909:7:0", + "typeDescriptions": {} + } + }, + "id": 504, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7909:13:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 505, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 493, + "src": "7924:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 506, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 483, + "src": "7934:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 500, + "name": "getAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 360, + "src": "7896:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_address_$_t_address_$_t_address_$returns$_t_struct$_Allowance_$75_memory_ptr_$", + "typeString": "function (address,address,address) view returns (struct AllowanceModule.Allowance memory)" + } + }, + "id": 507, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7896:44:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "7867:73:0" + }, + { + "assignments": [ + 510 + ], + "declarations": [ + { + "constant": false, + "id": 510, + "mutability": "mutable", + "name": "transferHashData", + "nodeType": "VariableDeclaration", + "scope": 685, + "src": "7950:29:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 509, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "7950:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "id": 524, + "initialValue": { + "arguments": [ + { + "arguments": [ + { + "id": 514, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 481, + "src": "8015:4:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + ], + "id": 513, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "8007:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 512, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "8007:7:0", + "typeDescriptions": {} + } + }, + "id": 515, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8007:13:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 516, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 483, + "src": "8022:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 517, + "name": "to", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 485, + "src": "8029:2:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "id": 518, + "name": "amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 487, + "src": "8033:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + { + "id": 519, + "name": "paymentToken", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 489, + "src": "8041:12:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 520, + "name": "payment", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 491, + "src": "8055:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + { + "expression": { + "id": 521, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 499, + "src": "8064:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 522, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "nonce", + "nodeType": "MemberAccess", + "referencedDeclaration": 74, + "src": "8064:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + ], + "id": 511, + "name": "generateTransferHashData", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 766, + "src": "7982:24:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_address_$_t_address_$_t_address_$_t_uint96_$_t_address_$_t_uint96_$_t_uint16_$returns$_t_bytes_memory_ptr_$", + "typeString": "function (address,address,address,uint96,address,uint96,uint16) view returns (bytes memory)" + } + }, + "id": 523, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7982:98:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "7950:130:0" + }, + { + "expression": { + "id": 532, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 525, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 499, + "src": "8115:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 527, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "nonce", + "nodeType": "MemberAccess", + "referencedDeclaration": 74, + "src": "8115:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "commonType": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + }, + "id": 531, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 528, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 499, + "src": "8133:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 529, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "nonce", + "nodeType": "MemberAccess", + "referencedDeclaration": 74, + "src": "8133:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "hexValue": "31", + "id": 530, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8151:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "8133:19:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "src": "8115:37:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "id": 533, + "nodeType": "ExpressionStatement", + "src": "8115:37:0" + }, + { + "assignments": [ + 535 + ], + "declarations": [ + { + "constant": false, + "id": 535, + "mutability": "mutable", + "name": "newSpent", + "nodeType": "VariableDeclaration", + "scope": 685, + "src": "8162:15:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "typeName": { + "id": 534, + "name": "uint96", + "nodeType": "ElementaryTypeName", + "src": "8162:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "visibility": "internal" + } + ], + "id": 540, + "initialValue": { + "commonType": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "id": 539, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 536, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 499, + "src": "8180:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 537, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "spent", + "nodeType": "MemberAccess", + "referencedDeclaration": 68, + "src": "8180:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "id": 538, + "name": "amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 487, + "src": "8198:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "src": "8180:24:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "8162:42:0" + }, + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 550, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "commonType": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "id": 545, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 542, + "name": "newSpent", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 535, + "src": "8269:8:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "expression": { + "id": 543, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 499, + "src": "8280:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 544, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "spent", + "nodeType": "MemberAccess", + "referencedDeclaration": 68, + "src": "8280:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "src": "8269:26:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "&&", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "id": 549, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 546, + "name": "newSpent", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 535, + "src": "8299:8:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "expression": { + "id": 547, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 499, + "src": "8311:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 548, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "amount", + "nodeType": "MemberAccess", + "referencedDeclaration": 66, + "src": "8311:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "src": "8299:28:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "8269:58:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "hexValue": "6e65775370656e74203e20616c6c6f77616e63652e7370656e74202626206e65775370656e74203c3d20616c6c6f77616e63652e616d6f756e74", + "id": 551, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8329:60:0", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_a7359a8519961096cf8fb65715f77dbc4de2755aabf21e3445e245a34ee622da", + "typeString": "literal_string \"newSpent > allowance.spent && newSpent <= allowance.amount\"" + }, + "value": "newSpent > allowance.spent && newSpent <= allowance.amount" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_a7359a8519961096cf8fb65715f77dbc4de2755aabf21e3445e245a34ee622da", + "typeString": "literal_string \"newSpent > allowance.spent && newSpent <= allowance.amount\"" + } + ], + "id": 541, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "8261:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 552, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8261:129:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 553, + "nodeType": "ExpressionStatement", + "src": "8261:129:0" + }, + { + "expression": { + "id": 558, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 554, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 499, + "src": "8400:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 556, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "spent", + "nodeType": "MemberAccess", + "referencedDeclaration": 68, + "src": "8400:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "id": 557, + "name": "newSpent", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 535, + "src": "8418:8:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "src": "8400:26:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "id": 559, + "nodeType": "ExpressionStatement", + "src": "8400:26:0" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "id": 562, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 560, + "name": "payment", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 491, + "src": "8440:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "hexValue": "30", + "id": 561, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8450:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "8440:11:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 620, + "nodeType": "IfStatement", + "src": "8436:748:0", + "trueBody": { + "id": 619, + "nodeType": "Block", + "src": "8453:731:0", + "statements": [ + { + "assignments": [ + 564 + ], + "declarations": [ + { + "constant": false, + "id": 564, + "mutability": "mutable", + "name": "paymentAllowance", + "nodeType": "VariableDeclaration", + "scope": 619, + "src": "8543:33:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance" + }, + "typeName": { + "id": 563, + "name": "Allowance", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 75, + "src": "8543:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_storage_ptr", + "typeString": "struct AllowanceModule.Allowance" + } + }, + "visibility": "internal" + } + ], + "id": 578, + "initialValue": { + "condition": { + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 567, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 565, + "name": "paymentToken", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 489, + "src": "8579:12:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "id": 566, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 483, + "src": "8595:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "8579:21:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseExpression": { + "arguments": [ + { + "arguments": [ + { + "id": 572, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 481, + "src": "8636:4:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + ], + "id": 571, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "8628:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 570, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "8628:7:0", + "typeDescriptions": {} + } + }, + "id": 573, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8628:13:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 574, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 493, + "src": "8643:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 575, + "name": "paymentToken", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 489, + "src": "8653:12:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 569, + "name": "getAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 360, + "src": "8615:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_address_$_t_address_$_t_address_$returns$_t_struct$_Allowance_$75_memory_ptr_$", + "typeString": "function (address,address,address) view returns (struct AllowanceModule.Allowance memory)" + } + }, + "id": 576, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8615:51:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 577, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "Conditional", + "src": "8579:87:0", + "trueExpression": { + "id": 568, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 499, + "src": "8603:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "8543:123:0" + }, + { + "expression": { + "id": 584, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 579, + "name": "newSpent", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 535, + "src": "8680:8:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "commonType": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "id": 583, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 580, + "name": "paymentAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 564, + "src": "8691:16:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 581, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "spent", + "nodeType": "MemberAccess", + "referencedDeclaration": 68, + "src": "8691:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "id": 582, + "name": "payment", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 491, + "src": "8716:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "src": "8691:32:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "src": "8680:43:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "id": 585, + "nodeType": "ExpressionStatement", + "src": "8680:43:0" + }, + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 595, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "commonType": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "id": 590, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 587, + "name": "newSpent", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 535, + "src": "8796:8:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "expression": { + "id": 588, + "name": "paymentAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 564, + "src": "8807:16:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 589, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "spent", + "nodeType": "MemberAccess", + "referencedDeclaration": 68, + "src": "8807:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "src": "8796:33:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "&&", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "id": 594, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 591, + "name": "newSpent", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 535, + "src": "8833:8:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "expression": { + "id": 592, + "name": "paymentAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 564, + "src": "8845:16:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 593, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "amount", + "nodeType": "MemberAccess", + "referencedDeclaration": 66, + "src": "8845:23:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "src": "8833:35:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "8796:72:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "hexValue": "6e65775370656e74203e207061796d656e74416c6c6f77616e63652e7370656e74202626206e65775370656e74203c3d207061796d656e74416c6c6f77616e63652e616d6f756e74", + "id": 596, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8870:74:0", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_b549d52c5706645679000944ae1bcaec935d0b8c387f4240a09789be7dc8c0d4", + "typeString": "literal_string \"newSpent > paymentAllowance.spent && newSpent <= paymentAllowance.amount\"" + }, + "value": "newSpent > paymentAllowance.spent && newSpent <= paymentAllowance.amount" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_b549d52c5706645679000944ae1bcaec935d0b8c387f4240a09789be7dc8c0d4", + "typeString": "literal_string \"newSpent > paymentAllowance.spent && newSpent <= paymentAllowance.amount\"" + } + ], + "id": 586, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "8788:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 597, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8788:157:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 598, + "nodeType": "ExpressionStatement", + "src": "8788:157:0" + }, + { + "expression": { + "id": 603, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 599, + "name": "paymentAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 564, + "src": "8959:16:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 601, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "spent", + "nodeType": "MemberAccess", + "referencedDeclaration": 68, + "src": "8959:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "id": 602, + "name": "newSpent", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 535, + "src": "8984:8:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "src": "8959:33:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "id": 604, + "nodeType": "ExpressionStatement", + "src": "8959:33:0" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 607, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 605, + "name": "paymentToken", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 489, + "src": "9078:12:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "id": 606, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 483, + "src": "9094:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "9078:21:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 618, + "nodeType": "IfStatement", + "src": "9074:99:0", + "trueBody": { + "expression": { + "arguments": [ + { + "arguments": [ + { + "id": 611, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 481, + "src": "9125:4:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + ], + "id": 610, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "9117:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 609, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "9117:7:0", + "typeDescriptions": {} + } + }, + "id": 612, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9117:13:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 613, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 493, + "src": "9132:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 614, + "name": "paymentToken", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 489, + "src": "9142:12:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 615, + "name": "paymentAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 564, + "src": "9156:16:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + ], + "id": 608, + "name": "updateAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 382, + "src": "9101:15:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_address_$_t_struct$_Allowance_$75_memory_ptr_$returns$__$", + "typeString": "function (address,address,address,struct AllowanceModule.Allowance memory)" + } + }, + "id": 616, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9101:72:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 617, + "nodeType": "ExpressionStatement", + "src": "9101:72:0" + } + } + ] + } + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "id": 624, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 481, + "src": "9217:4:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + ], + "id": 623, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "9209:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 622, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "9209:7:0", + "typeDescriptions": {} + } + }, + "id": 625, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9209:13:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 626, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 493, + "src": "9224:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 627, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 483, + "src": "9234:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 628, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 499, + "src": "9241:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + ], + "id": 621, + "name": "updateAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 382, + "src": "9193:15:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_address_$_t_struct$_Allowance_$75_memory_ptr_$returns$__$", + "typeString": "function (address,address,address,struct AllowanceModule.Allowance memory)" + } + }, + "id": 629, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9193:58:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 630, + "nodeType": "ExpressionStatement", + "src": "9193:58:0" + }, + { + "expression": { + "arguments": [ + { + "id": 632, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 493, + "src": "9345:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 633, + "name": "signature", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 495, + "src": "9355:9:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + { + "id": 634, + "name": "transferHashData", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 510, + "src": "9366:16:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + { + "id": 635, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 481, + "src": "9384:4:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + }, + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + }, + { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + ], + "id": 631, + "name": "checkSignature", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 840, + "src": "9330:14:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_address_$_t_bytes_memory_ptr_$_t_bytes_memory_ptr_$_t_contract$_GnosisSafe_$18_$returns$__$", + "typeString": "function (address,bytes memory,bytes memory,contract GnosisSafe) view" + } + }, + "id": 636, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9330:59:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 637, + "nodeType": "ExpressionStatement", + "src": "9330:59:0" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "id": 640, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 638, + "name": "payment", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 491, + "src": "9404:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "hexValue": "30", + "id": 639, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "9414:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "9404:11:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 662, + "nodeType": "IfStatement", + "src": "9400:344:0", + "trueBody": { + "id": 661, + "nodeType": "Block", + "src": "9417:327:0", + "statements": [ + { + "expression": { + "arguments": [ + { + "id": 642, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 481, + "src": "9534:4:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + }, + { + "id": 643, + "name": "paymentToken", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 489, + "src": "9540:12:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "expression": { + "id": 644, + "name": "tx", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -26, + "src": "9554:2:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_transaction", + "typeString": "tx" + } + }, + "id": 645, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "origin", + "nodeType": "MemberAccess", + "src": "9554:9:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "id": 646, + "name": "payment", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 491, + "src": "9565:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + ], + "id": 641, + "name": "transfer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1006, + "src": "9525:8:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_contract$_GnosisSafe_$18_$_t_address_$_t_address_payable_$_t_uint96_$returns$__$", + "typeString": "function (contract GnosisSafe,address,address payable,uint96)" + } + }, + "id": 647, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9525:48:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 648, + "nodeType": "ExpressionStatement", + "src": "9525:48:0" + }, + { + "eventCall": { + "arguments": [ + { + "arguments": [ + { + "id": 652, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 481, + "src": "9683:4:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + ], + "id": 651, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "9675:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 650, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "9675:7:0", + "typeDescriptions": {} + } + }, + "id": 653, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9675:13:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 654, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 493, + "src": "9690:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 655, + "name": "paymentToken", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 489, + "src": "9700:12:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "expression": { + "id": 656, + "name": "tx", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -26, + "src": "9714:2:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_transaction", + "typeString": "tx" + } + }, + "id": 657, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "origin", + "nodeType": "MemberAccess", + "src": "9714:9:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "id": 658, + "name": "payment", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 491, + "src": "9725:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + ], + "id": 649, + "name": "PayAllowanceTransfer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 113, + "src": "9654:20:0", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_address_$_t_address_$_t_uint96_$returns$__$", + "typeString": "function (address,address,address,address,uint96)" + } + }, + "id": 659, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9654:79:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 660, + "nodeType": "EmitStatement", + "src": "9649:84:0" + } + ] + } + }, + { + "expression": { + "arguments": [ + { + "id": 664, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 481, + "src": "9788:4:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + }, + { + "id": 665, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 483, + "src": "9794:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 666, + "name": "to", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 485, + "src": "9801:2:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "id": 667, + "name": "amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 487, + "src": "9805:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + ], + "id": 663, + "name": "transfer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1006, + "src": "9779:8:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_contract$_GnosisSafe_$18_$_t_address_$_t_address_payable_$_t_uint96_$returns$__$", + "typeString": "function (contract GnosisSafe,address,address payable,uint96)" + } + }, + "id": 668, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9779:33:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 669, + "nodeType": "ExpressionStatement", + "src": "9779:33:0" + }, + { + "eventCall": { + "arguments": [ + { + "arguments": [ + { + "id": 673, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 481, + "src": "9860:4:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + ], + "id": 672, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "9852:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 671, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "9852:7:0", + "typeDescriptions": {} + } + }, + "id": 674, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9852:13:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 675, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 493, + "src": "9867:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 676, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 483, + "src": "9877:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 677, + "name": "to", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 485, + "src": "9884:2:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "id": 678, + "name": "amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 487, + "src": "9888:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + { + "commonType": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + }, + "id": 682, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 679, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 499, + "src": "9896:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 680, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "nonce", + "nodeType": "MemberAccess", + "referencedDeclaration": 74, + "src": "9896:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "hexValue": "31", + "id": 681, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "9914:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "9896:19:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + ], + "id": 670, + "name": "ExecuteAllowanceTransfer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 101, + "src": "9827:24:0", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_address_$_t_address_$_t_uint96_$_t_uint16_$returns$__$", + "typeString": "function (address,address,address,address,uint96,uint16)" + } + }, + "id": 683, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9827:89:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 684, + "nodeType": "EmitStatement", + "src": "9822:94:0" + } + ] + }, + "documentation": { + "id": 479, + "nodeType": "StructuredDocumentation", + "src": "6961:604:0", + "text": "@dev Allows to use the allowance to perform a transfer.\n @param safe The Safe whose funds should be used.\n @param token Token contract address.\n @param to Address that should receive the tokens.\n @param amount Amount that should be transferred.\n @param paymentToken Token that should be used to pay for the execution of the transfer.\n @param payment Amount to should be paid for executing the transfer.\n @param delegate Delegate whose allowance should be updated.\n @param signature Signature generated by the delegate to authorize the transfer." + }, + "functionSelector": "4515641a", + "id": 686, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "executeAllowanceTransfer", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 496, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 481, + "mutability": "mutable", + "name": "safe", + "nodeType": "VariableDeclaration", + "scope": 686, + "src": "7613:15:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + }, + "typeName": { + "id": 480, + "name": "GnosisSafe", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 18, + "src": "7613:10:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 483, + "mutability": "mutable", + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 686, + "src": "7638:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 482, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "7638:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 485, + "mutability": "mutable", + "name": "to", + "nodeType": "VariableDeclaration", + "scope": 686, + "src": "7661:18:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + "typeName": { + "id": 484, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "7661:15:0", + "stateMutability": "payable", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 487, + "mutability": "mutable", + "name": "amount", + "nodeType": "VariableDeclaration", + "scope": 686, + "src": "7689:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "typeName": { + "id": 486, + "name": "uint96", + "nodeType": "ElementaryTypeName", + "src": "7689:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 489, + "mutability": "mutable", + "name": "paymentToken", + "nodeType": "VariableDeclaration", + "scope": 686, + "src": "7712:20:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 488, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "7712:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 491, + "mutability": "mutable", + "name": "payment", + "nodeType": "VariableDeclaration", + "scope": 686, + "src": "7742:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "typeName": { + "id": 490, + "name": "uint96", + "nodeType": "ElementaryTypeName", + "src": "7742:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 493, + "mutability": "mutable", + "name": "delegate", + "nodeType": "VariableDeclaration", + "scope": 686, + "src": "7766:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 492, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "7766:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 495, + "mutability": "mutable", + "name": "signature", + "nodeType": "VariableDeclaration", + "scope": 686, + "src": "7792:22:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 494, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "7792:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "src": "7603:217:0" + }, + "returnParameters": { + "id": 497, + "nodeType": "ParameterList", + "parameters": [], + "src": "7828:0:0" + }, + "scope": 1428, + "src": "7570:2353:0", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "public" + }, + { + "body": { + "id": 698, + "nodeType": "Block", + "src": "10038:167:0", + "statements": [ + { + "assignments": [ + 693 + ], + "declarations": [ + { + "constant": false, + "id": 693, + "mutability": "mutable", + "name": "id", + "nodeType": "VariableDeclaration", + "scope": 698, + "src": "10048:10:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 692, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "10048:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 694, + "nodeType": "VariableDeclarationStatement", + "src": "10048:10:0" + }, + { + "AST": { + "nodeType": "YulBlock", + "src": "10141:39:0", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "10155:15:0", + "value": { + "arguments": [], + "functionName": { + "name": "chainid", + "nodeType": "YulIdentifier", + "src": "10161:7:0" + }, + "nodeType": "YulFunctionCall", + "src": "10161:9:0" + }, + "variableNames": [ + { + "name": "id", + "nodeType": "YulIdentifier", + "src": "10155:2:0" + } + ] + } + ] + }, + "evmVersion": "istanbul", + "externalReferences": [ + { + "declaration": 693, + "isOffset": false, + "isSlot": false, + "src": "10155:2:0", + "valueSize": 1 + } + ], + "id": 695, + "nodeType": "InlineAssembly", + "src": "10132:48:0" + }, + { + "expression": { + "id": 696, + "name": "id", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 693, + "src": "10196:2:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 691, + "id": 697, + "nodeType": "Return", + "src": "10189:9:0" + } + ] + }, + "documentation": { + "id": 687, + "nodeType": "StructuredDocumentation", + "src": "9929:52:0", + "text": "@dev Returns the chain id used by this contract." + }, + "functionSelector": "3408e470", + "id": 699, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getChainId", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 688, + "nodeType": "ParameterList", + "parameters": [], + "src": "10005:2:0" + }, + "returnParameters": { + "id": 691, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 690, + "mutability": "mutable", + "name": "", + "nodeType": "VariableDeclaration", + "scope": 699, + "src": "10029:7:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 689, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "10029:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "10028:9:0" + }, + "scope": 1428, + "src": "9986:219:0", + "stateMutability": "pure", + "virtual": false, + "visibility": "public" + }, + { + "body": { + "id": 765, + "nodeType": "Block", + "src": "10528:394:0", + "statements": [ + { + "assignments": [ + 720 + ], + "declarations": [ + { + "constant": false, + "id": 720, + "mutability": "mutable", + "name": "chainId", + "nodeType": "VariableDeclaration", + "scope": 765, + "src": "10538:15:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 719, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "10538:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 723, + "initialValue": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 721, + "name": "getChainId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 699, + "src": "10556:10:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$__$returns$_t_uint256_$", + "typeString": "function () pure returns (uint256)" + } + }, + "id": 722, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10556:12:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "10538:30:0" + }, + { + "assignments": [ + 725 + ], + "declarations": [ + { + "constant": false, + "id": 725, + "mutability": "mutable", + "name": "domainSeparator", + "nodeType": "VariableDeclaration", + "scope": 765, + "src": "10578:23:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 724, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "10578:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "id": 734, + "initialValue": { + "arguments": [ + { + "arguments": [ + { + "id": 729, + "name": "DOMAIN_SEPARATOR_TYPEHASH", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 29, + "src": "10625:25:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "id": 730, + "name": "chainId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 720, + "src": "10652:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 731, + "name": "this", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -28, + "src": "10661:4:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_AllowanceModule_$1428", + "typeString": "contract AllowanceModule" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_contract$_AllowanceModule_$1428", + "typeString": "contract AllowanceModule" + } + ], + "expression": { + "id": 727, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -1, + "src": "10614:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 728, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encode", + "nodeType": "MemberAccess", + "src": "10614:10:0", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencode_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 732, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10614:52:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 726, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -8, + "src": "10604:9:0", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 733, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10604:63:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "10578:89:0" + }, + { + "assignments": [ + 736 + ], + "declarations": [ + { + "constant": false, + "id": 736, + "mutability": "mutable", + "name": "transferHash", + "nodeType": "VariableDeclaration", + "scope": 765, + "src": "10677:20:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 735, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "10677:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "id": 750, + "initialValue": { + "arguments": [ + { + "arguments": [ + { + "id": 740, + "name": "ALLOWANCE_TRANSFER_TYPEHASH", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 32, + "src": "10734:27:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "id": 741, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 702, + "src": "10763:4:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 742, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 704, + "src": "10769:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 743, + "name": "to", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 706, + "src": "10776:2:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 744, + "name": "amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 708, + "src": "10780:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + { + "id": 745, + "name": "paymentToken", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 710, + "src": "10788:12:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 746, + "name": "payment", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 712, + "src": "10802:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + { + "id": 747, + "name": "nonce", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 714, + "src": "10811:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + ], + "expression": { + "id": 738, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -1, + "src": "10723:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 739, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encode", + "nodeType": "MemberAccess", + "src": "10723:10:0", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencode_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 748, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10723:94:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 737, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -8, + "src": "10700:9:0", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 749, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10700:127:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "10677:150:0" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "hexValue": "30783139", + "id": 755, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10866:4:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_25_by_1", + "typeString": "int_const 25" + }, + "value": "0x19" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_25_by_1", + "typeString": "int_const 25" + } + ], + "id": 754, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "10861:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes1_$", + "typeString": "type(bytes1)" + }, + "typeName": { + "id": 753, + "name": "byte", + "nodeType": "ElementaryTypeName", + "src": "10861:4:0", + "typeDescriptions": {} + } + }, + "id": 756, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10861:10:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + { + "arguments": [ + { + "hexValue": "30783031", + "id": 759, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10878:4:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "0x01" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + } + ], + "id": 758, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "10873:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes1_$", + "typeString": "type(bytes1)" + }, + "typeName": { + "id": 757, + "name": "byte", + "nodeType": "ElementaryTypeName", + "src": "10873:4:0", + "typeDescriptions": {} + } + }, + "id": 760, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10873:10:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + { + "id": 761, + "name": "domainSeparator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 725, + "src": "10885:15:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "id": 762, + "name": "transferHash", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 736, + "src": "10902:12:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + }, + { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "expression": { + "id": 751, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -1, + "src": "10844:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 752, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "src": "10844:16:0", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 763, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10844:71:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "functionReturnParameters": 718, + "id": 764, + "nodeType": "Return", + "src": "10837:78:0" + } + ] + }, + "documentation": { + "id": 700, + "nodeType": "StructuredDocumentation", + "src": "10211:72:0", + "text": "@dev Generates the data for the transfer hash (required for signing)" + }, + "id": 766, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "generateTransferHashData", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 715, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 702, + "mutability": "mutable", + "name": "safe", + "nodeType": "VariableDeclaration", + "scope": 766, + "src": "10331:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 701, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "10331:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 704, + "mutability": "mutable", + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 766, + "src": "10353:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 703, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "10353:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 706, + "mutability": "mutable", + "name": "to", + "nodeType": "VariableDeclaration", + "scope": 766, + "src": "10376:10:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 705, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "10376:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 708, + "mutability": "mutable", + "name": "amount", + "nodeType": "VariableDeclaration", + "scope": 766, + "src": "10396:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "typeName": { + "id": 707, + "name": "uint96", + "nodeType": "ElementaryTypeName", + "src": "10396:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 710, + "mutability": "mutable", + "name": "paymentToken", + "nodeType": "VariableDeclaration", + "scope": 766, + "src": "10419:20:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 709, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "10419:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 712, + "mutability": "mutable", + "name": "payment", + "nodeType": "VariableDeclaration", + "scope": 766, + "src": "10449:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "typeName": { + "id": 711, + "name": "uint96", + "nodeType": "ElementaryTypeName", + "src": "10449:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 714, + "mutability": "mutable", + "name": "nonce", + "nodeType": "VariableDeclaration", + "scope": 766, + "src": "10473:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + }, + "typeName": { + "id": 713, + "name": "uint16", + "nodeType": "ElementaryTypeName", + "src": "10473:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "visibility": "internal" + } + ], + "src": "10321:170:0" + }, + "returnParameters": { + "id": 718, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 717, + "mutability": "mutable", + "name": "", + "nodeType": "VariableDeclaration", + "scope": 766, + "src": "10514:12:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 716, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "10514:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "src": "10513:14:0" + }, + "scope": 1428, + "src": "10288:634:0", + "stateMutability": "view", + "virtual": false, + "visibility": "private" + }, + { + "body": { + "id": 798, + "nodeType": "Block", + "src": "11245:136:0", + "statements": [ + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "id": 788, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 769, + "src": "11310:4:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 789, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 771, + "src": "11316:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 790, + "name": "to", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 773, + "src": "11323:2:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 791, + "name": "amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 775, + "src": "11327:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + { + "id": 792, + "name": "paymentToken", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 777, + "src": "11335:12:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 793, + "name": "payment", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 779, + "src": "11349:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + { + "id": 794, + "name": "nonce", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 781, + "src": "11358:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + ], + "id": 787, + "name": "generateTransferHashData", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 766, + "src": "11272:24:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_address_$_t_address_$_t_address_$_t_uint96_$_t_address_$_t_uint96_$_t_uint16_$returns$_t_bytes_memory_ptr_$", + "typeString": "function (address,address,address,uint96,address,uint96,uint16) view returns (bytes memory)" + } + }, + "id": 795, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11272:101:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 786, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -8, + "src": "11262:9:0", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 796, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11262:112:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "functionReturnParameters": 785, + "id": 797, + "nodeType": "Return", + "src": "11255:119:0" + } + ] + }, + "documentation": { + "id": 767, + "nodeType": "StructuredDocumentation", + "src": "10928:82:0", + "text": "@dev Generates the transfer hash that should be signed to authorize a transfer" + }, + "functionSelector": "d626e043", + "id": 799, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "generateTransferHash", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 782, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 769, + "mutability": "mutable", + "name": "safe", + "nodeType": "VariableDeclaration", + "scope": 799, + "src": "11054:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 768, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "11054:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 771, + "mutability": "mutable", + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 799, + "src": "11076:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 770, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "11076:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 773, + "mutability": "mutable", + "name": "to", + "nodeType": "VariableDeclaration", + "scope": 799, + "src": "11099:10:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 772, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "11099:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 775, + "mutability": "mutable", + "name": "amount", + "nodeType": "VariableDeclaration", + "scope": 799, + "src": "11119:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "typeName": { + "id": 774, + "name": "uint96", + "nodeType": "ElementaryTypeName", + "src": "11119:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 777, + "mutability": "mutable", + "name": "paymentToken", + "nodeType": "VariableDeclaration", + "scope": 799, + "src": "11142:20:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 776, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "11142:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 779, + "mutability": "mutable", + "name": "payment", + "nodeType": "VariableDeclaration", + "scope": 799, + "src": "11172:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "typeName": { + "id": 778, + "name": "uint96", + "nodeType": "ElementaryTypeName", + "src": "11172:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 781, + "mutability": "mutable", + "name": "nonce", + "nodeType": "VariableDeclaration", + "scope": 799, + "src": "11196:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + }, + "typeName": { + "id": 780, + "name": "uint16", + "nodeType": "ElementaryTypeName", + "src": "11196:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "visibility": "internal" + } + ], + "src": "11044:170:0" + }, + "returnParameters": { + "id": 785, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 784, + "mutability": "mutable", + "name": "", + "nodeType": "VariableDeclaration", + "scope": 799, + "src": "11236:7:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 783, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "11236:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "11235:9:0" + }, + "scope": 1428, + "src": "11015:366:0", + "stateMutability": "view", + "virtual": false, + "visibility": "public" + }, + { + "body": { + "id": 839, + "nodeType": "Block", + "src": "11522:314:0", + "statements": [ + { + "assignments": [ + 811 + ], + "declarations": [ + { + "constant": false, + "id": 811, + "mutability": "mutable", + "name": "signer", + "nodeType": "VariableDeclaration", + "scope": 839, + "src": "11532:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 810, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "11532:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "id": 816, + "initialValue": { + "arguments": [ + { + "id": 813, + "name": "signature", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 803, + "src": "11566:9:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + { + "id": 814, + "name": "transferHashData", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 805, + "src": "11577:16:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + }, + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 812, + "name": "recoverSignature", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 950, + "src": "11549:16:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_bytes_memory_ptr_$_t_bytes_memory_ptr_$returns$_t_address_$", + "typeString": "function (bytes memory,bytes memory) view returns (address)" + } + }, + "id": 815, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11549:45:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "11532:62:0" + }, + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 835, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 820, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 818, + "name": "expectedDelegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 801, + "src": "11625:16:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "id": 819, + "name": "signer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 811, + "src": "11645:6:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "11625:26:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "&&", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 834, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "baseExpression": { + "baseExpression": { + "id": 821, + "name": "delegates", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 57, + "src": "11655:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_uint48_$_t_struct$_Delegate_$64_storage_$_$", + "typeString": "mapping(address => mapping(uint48 => struct AllowanceModule.Delegate storage ref))" + } + }, + "id": 826, + "indexExpression": { + "arguments": [ + { + "id": 824, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 807, + "src": "11673:4:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + ], + "id": 823, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "11665:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 822, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "11665:7:0", + "typeDescriptions": {} + } + }, + "id": 825, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11665:13:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "11655:24:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint48_$_t_struct$_Delegate_$64_storage_$", + "typeString": "mapping(uint48 => struct AllowanceModule.Delegate storage ref)" + } + }, + "id": 831, + "indexExpression": { + "arguments": [ + { + "id": 829, + "name": "signer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 811, + "src": "11687:6:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 828, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "11680:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint48_$", + "typeString": "type(uint48)" + }, + "typeName": { + "id": 827, + "name": "uint48", + "nodeType": "ElementaryTypeName", + "src": "11680:6:0", + "typeDescriptions": {} + } + }, + "id": 830, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11680:14:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "11655:40:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$64_storage", + "typeString": "struct AllowanceModule.Delegate storage ref" + } + }, + "id": 832, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "delegate", + "nodeType": "MemberAccess", + "referencedDeclaration": 59, + "src": "11655:49:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "id": 833, + "name": "signer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 811, + "src": "11708:6:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "11655:59:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "11625:89:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "hexValue": "657870656374656444656c6567617465203d3d207369676e65722026262064656c6567617465735b616464726573732873616665295d5b75696e743438287369676e6572295d2e64656c6567617465203d3d207369676e6572", + "id": 836, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "11728:91:0", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_967a409fd152609403ac7b3349d7ced54d05d2ee8664844edf017668d343240b", + "typeString": "literal_string \"expectedDelegate == signer && delegates[address(safe)][uint48(signer)].delegate == signer\"" + }, + "value": "expectedDelegate == signer && delegates[address(safe)][uint48(signer)].delegate == signer" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_967a409fd152609403ac7b3349d7ced54d05d2ee8664844edf017668d343240b", + "typeString": "literal_string \"expectedDelegate == signer && delegates[address(safe)][uint48(signer)].delegate == signer\"" + } + ], + "id": 817, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "11604:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 837, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11604:225:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 838, + "nodeType": "ExpressionStatement", + "src": "11604:225:0" + } + ] + }, + "id": 840, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "checkSignature", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 808, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 801, + "mutability": "mutable", + "name": "expectedDelegate", + "nodeType": "VariableDeclaration", + "scope": 840, + "src": "11411:24:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 800, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "11411:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 803, + "mutability": "mutable", + "name": "signature", + "nodeType": "VariableDeclaration", + "scope": 840, + "src": "11437:22:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 802, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "11437:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 805, + "mutability": "mutable", + "name": "transferHashData", + "nodeType": "VariableDeclaration", + "scope": 840, + "src": "11461:29:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 804, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "11461:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 807, + "mutability": "mutable", + "name": "safe", + "nodeType": "VariableDeclaration", + "scope": 840, + "src": "11492:15:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + }, + "typeName": { + "id": 806, + "name": "GnosisSafe", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 18, + "src": "11492:10:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + }, + "visibility": "internal" + } + ], + "src": "11410:98:0" + }, + "returnParameters": { + "id": 809, + "nodeType": "ParameterList", + "parameters": [], + "src": "11522:0:0" + }, + "scope": 1428, + "src": "11387:449:0", + "stateMutability": "view", + "virtual": false, + "visibility": "private" + }, + { + "body": { + "id": 949, + "nodeType": "Block", + "src": "12097:1333:0", + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 852, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 849, + "name": "signature", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 842, + "src": "12178:9:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 850, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "length", + "nodeType": "MemberAccess", + "src": "12178:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "30", + "id": 851, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12198:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "12178:21:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 856, + "nodeType": "IfStatement", + "src": "12174:44:0", + "trueBody": { + "expression": { + "expression": { + "id": 853, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "12208:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 854, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "12208:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "functionReturnParameters": 848, + "id": 855, + "nodeType": "Return", + "src": "12201:17:0" + } + }, + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 861, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 858, + "name": "signature", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 842, + "src": "12326:9:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 859, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "length", + "nodeType": "MemberAccess", + "src": "12326:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "3635", + "id": 860, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12346:2:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_65_by_1", + "typeString": "int_const 65" + }, + "value": "65" + }, + "src": "12326:22:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "hexValue": "7369676e6174757265732e6c656e677468203d3d203635", + "id": 862, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12350:25:0", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_596a1fa41ba579d6aea221d825354132f4526efd6f16816b6df5045603592f81", + "typeString": "literal_string \"signatures.length == 65\"" + }, + "value": "signatures.length == 65" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_596a1fa41ba579d6aea221d825354132f4526efd6f16816b6df5045603592f81", + "typeString": "literal_string \"signatures.length == 65\"" + } + ], + "id": 857, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "12318:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 863, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12318:58:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 864, + "nodeType": "ExpressionStatement", + "src": "12318:58:0" + }, + { + "assignments": [ + 866 + ], + "declarations": [ + { + "constant": false, + "id": 866, + "mutability": "mutable", + "name": "v", + "nodeType": "VariableDeclaration", + "scope": 949, + "src": "12386:7:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "typeName": { + "id": 865, + "name": "uint8", + "nodeType": "ElementaryTypeName", + "src": "12386:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "visibility": "internal" + } + ], + "id": 867, + "nodeType": "VariableDeclarationStatement", + "src": "12386:7:0" + }, + { + "assignments": [ + 869 + ], + "declarations": [ + { + "constant": false, + "id": 869, + "mutability": "mutable", + "name": "r", + "nodeType": "VariableDeclaration", + "scope": 949, + "src": "12403:9:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 868, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "12403:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "id": 870, + "nodeType": "VariableDeclarationStatement", + "src": "12403:9:0" + }, + { + "assignments": [ + 872 + ], + "declarations": [ + { + "constant": false, + "id": 872, + "mutability": "mutable", + "name": "s", + "nodeType": "VariableDeclaration", + "scope": 949, + "src": "12422:9:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 871, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "12422:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "id": 873, + "nodeType": "VariableDeclarationStatement", + "src": "12422:9:0" + }, + { + "expression": { + "id": 882, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "components": [ + { + "id": 874, + "name": "v", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 866, + "src": "12442:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + { + "id": 875, + "name": "r", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 869, + "src": "12445:1:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "id": 876, + "name": "s", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 872, + "src": "12448:1:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "id": 877, + "isConstant": false, + "isInlineArray": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "TupleExpression", + "src": "12441:9:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_uint8_$_t_bytes32_$_t_bytes32_$", + "typeString": "tuple(uint8,bytes32,bytes32)" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "id": 879, + "name": "signature", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 842, + "src": "12468:9:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + { + "hexValue": "30", + "id": 880, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12479:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + }, + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 878, + "name": "signatureSplit", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1550, + "src": "12453:14:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$_t_uint256_$returns$_t_uint8_$_t_bytes32_$_t_bytes32_$", + "typeString": "function (bytes memory,uint256) pure returns (uint8,bytes32,bytes32)" + } + }, + "id": 881, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12453:28:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_uint8_$_t_bytes32_$_t_bytes32_$", + "typeString": "tuple(uint8,bytes32,bytes32)" + } + }, + "src": "12441:40:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 883, + "nodeType": "ExpressionStatement", + "src": "12441:40:0" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "id": 886, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 884, + "name": "v", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 866, + "src": "12548:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "30", + "id": 885, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12553:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "12548:6:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "condition": { + "commonType": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "id": 894, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 892, + "name": "v", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 866, + "src": "12653:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "31", + "id": 893, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12658:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "12653:6:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "condition": { + "commonType": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "id": 903, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 901, + "name": "v", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 866, + "src": "12832:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "hexValue": "3330", + "id": 902, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12836:2:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_30_by_1", + "typeString": "int_const 30" + }, + "value": "30" + }, + "src": "12832:6:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "id": 935, + "nodeType": "Block", + "src": "13143:149:0", + "statements": [ + { + "expression": { + "id": 933, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 924, + "name": "owner", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 847, + "src": "13226:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "arguments": [ + { + "id": 927, + "name": "transferHashData", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 844, + "src": "13254:16:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 926, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -8, + "src": "13244:9:0", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 928, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13244:27:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "id": 929, + "name": "v", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 866, + "src": "13273:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + { + "id": 930, + "name": "r", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 869, + "src": "13276:1:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "id": 931, + "name": "s", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 872, + "src": "13279:1:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 925, + "name": "ecrecover", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -6, + "src": "13234:9:0", + "typeDescriptions": { + "typeIdentifier": "t_function_ecrecover_pure$_t_bytes32_$_t_uint8_$_t_bytes32_$_t_bytes32_$returns$_t_address_$", + "typeString": "function (bytes32,uint8,bytes32,bytes32) pure returns (address)" + } + }, + "id": 932, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13234:47:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "13226:55:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 934, + "nodeType": "ExpressionStatement", + "src": "13226:55:0" + } + ] + }, + "id": 936, + "nodeType": "IfStatement", + "src": "12828:464:0", + "trueBody": { + "id": 923, + "nodeType": "Block", + "src": "12840:297:0", + "statements": [ + { + "expression": { + "id": 921, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 904, + "name": "owner", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 847, + "src": "13002:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "arguments": [ + { + "arguments": [ + { + "hexValue": "19457468657265756d205369676e6564204d6573736167653a0a3332", + "id": 909, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13047:34:0", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_178a2411ab6fbc1ba11064408972259c558d0e82fd48b0aba3ad81d14f065e73", + "typeString": "literal_string \"\u0019Ethereum Signed Message:\n32\"" + }, + "value": "\u0019Ethereum Signed Message:\n32" + }, + { + "arguments": [ + { + "id": 911, + "name": "transferHashData", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 844, + "src": "13093:16:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 910, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -8, + "src": "13083:9:0", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 912, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13083:27:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_stringliteral_178a2411ab6fbc1ba11064408972259c558d0e82fd48b0aba3ad81d14f065e73", + "typeString": "literal_string \"\u0019Ethereum Signed Message:\n32\"" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "expression": { + "id": 907, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -1, + "src": "13030:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 908, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "src": "13030:16:0", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 913, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13030:81:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 906, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -8, + "src": "13020:9:0", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 914, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13020:92:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "commonType": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "id": 917, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 915, + "name": "v", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 866, + "src": "13114:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "hexValue": "34", + "id": 916, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13118:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_4_by_1", + "typeString": "int_const 4" + }, + "value": "4" + }, + "src": "13114:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + { + "id": 918, + "name": "r", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 869, + "src": "13121:1:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "id": 919, + "name": "s", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 872, + "src": "13124:1:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 905, + "name": "ecrecover", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -6, + "src": "13010:9:0", + "typeDescriptions": { + "typeIdentifier": "t_function_ecrecover_pure$_t_bytes32_$_t_uint8_$_t_bytes32_$_t_bytes32_$returns$_t_address_$", + "typeString": "function (bytes32,uint8,bytes32,bytes32) pure returns (address)" + } + }, + "id": 920, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13010:116:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "13002:124:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 922, + "nodeType": "ExpressionStatement", + "src": "13002:124:0" + } + ] + } + }, + "id": 937, + "nodeType": "IfStatement", + "src": "12649:643:0", + "trueBody": { + "id": 900, + "nodeType": "Block", + "src": "12661:161:0", + "statements": [ + { + "expression": { + "id": 898, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 895, + "name": "owner", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 847, + "src": "12793:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "expression": { + "id": 896, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "12801:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 897, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "12801:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "src": "12793:18:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 899, + "nodeType": "ExpressionStatement", + "src": "12793:18:0" + } + ] + } + }, + "id": 938, + "nodeType": "IfStatement", + "src": "12544:748:0", + "trueBody": { + "id": 891, + "nodeType": "Block", + "src": "12556:87:0", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "436f6e7472616374207369676e61747572657320617265206e6f7420737570706f727465642062792074686973206d6f64756c65", + "id": 888, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12577:54:0", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_b39fc396439fa2d21053daa8df1e6090b76cf041fa302da73b109291b14237bd", + "typeString": "literal_string \"Contract signatures are not supported by this module\"" + }, + "value": "Contract signatures are not supported by this module" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_stringliteral_b39fc396439fa2d21053daa8df1e6090b76cf041fa302da73b109291b14237bd", + "typeString": "literal_string \"Contract signatures are not supported by this module\"" + } + ], + "id": 887, + "name": "revert", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -19, + -19 + ], + "referencedDeclaration": -19, + "src": "12570:6:0", + "typeDescriptions": { + "typeIdentifier": "t_function_revert_pure$_t_string_memory_ptr_$returns$__$", + "typeString": "function (string memory) pure" + } + }, + "id": 889, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12570:62:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 890, + "nodeType": "ExpressionStatement", + "src": "12570:62:0" + } + ] + } + }, + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 945, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 940, + "name": "owner", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 847, + "src": "13380:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "arguments": [ + { + "hexValue": "30", + "id": 943, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13397:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 942, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "13389:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 941, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "13389:7:0", + "typeDescriptions": {} + } + }, + "id": 944, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13389:10:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "src": "13380:19:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "hexValue": "6f776e657220213d2061646472657373283029", + "id": 946, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13401:21:0", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_fa07c4489b96a4ba6d7948f5dd634975ac28da03dfd4c4c31f4f8e50c9c4d088", + "typeString": "literal_string \"owner != address(0)\"" + }, + "value": "owner != address(0)" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_fa07c4489b96a4ba6d7948f5dd634975ac28da03dfd4c4c31f4f8e50c9c4d088", + "typeString": "literal_string \"owner != address(0)\"" + } + ], + "id": 939, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "13372:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 947, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13372:51:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 948, + "nodeType": "ExpressionStatement", + "src": "13372:51:0" + } + ] + }, + "id": 950, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "recoverSignature", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 845, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 842, + "mutability": "mutable", + "name": "signature", + "nodeType": "VariableDeclaration", + "scope": 950, + "src": "12005:22:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 841, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "12005:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 844, + "mutability": "mutable", + "name": "transferHashData", + "nodeType": "VariableDeclaration", + "scope": 950, + "src": "12029:29:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 843, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "12029:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "src": "12004:55:0" + }, + "returnParameters": { + "id": 848, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 847, + "mutability": "mutable", + "name": "owner", + "nodeType": "VariableDeclaration", + "scope": 950, + "src": "12082:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 846, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "12082:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "12081:15:0" + }, + "scope": 1428, + "src": "11979:1451:0", + "stateMutability": "view", + "virtual": false, + "visibility": "private" + }, + { + "body": { + "id": 1005, + "nodeType": "Block", + "src": "13529:476:0", + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 966, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 961, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 954, + "src": "13543:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "arguments": [ + { + "hexValue": "30", + "id": 964, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13560:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 963, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "13552:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 962, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "13552:7:0", + "typeDescriptions": {} + } + }, + "id": 965, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13552:10:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "src": "13543:19:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "id": 1003, + "nodeType": "Block", + "src": "13764:235:0", + "statements": [ + { + "assignments": [ + 982 + ], + "declarations": [ + { + "constant": false, + "id": 982, + "mutability": "mutable", + "name": "data", + "nodeType": "VariableDeclaration", + "scope": 1003, + "src": "13778:17:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 981, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "13778:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "id": 989, + "initialValue": { + "arguments": [ + { + "hexValue": "7472616e7366657228616464726573732c75696e7432353629", + "id": 985, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13822:27:0", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_a9059cbb2ab09eb219583f4a59a5d0623ade346d962bcd4e46b11da047c9049b", + "typeString": "literal_string \"transfer(address,uint256)\"" + }, + "value": "transfer(address,uint256)" + }, + { + "id": 986, + "name": "to", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 956, + "src": "13851:2:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "id": 987, + "name": "amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 958, + "src": "13855:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_stringliteral_a9059cbb2ab09eb219583f4a59a5d0623ade346d962bcd4e46b11da047c9049b", + "typeString": "literal_string \"transfer(address,uint256)\"" + }, + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + ], + "expression": { + "id": 983, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -1, + "src": "13798:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 984, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encodeWithSignature", + "nodeType": "MemberAccess", + "src": "13798:23:0", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodewithsignature_pure$_t_string_memory_ptr_$returns$_t_bytes_memory_ptr_$", + "typeString": "function (string memory) pure returns (bytes memory)" + } + }, + "id": 988, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13798:64:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "13778:84:0" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "id": 993, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 954, + "src": "13915:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "hexValue": "30", + "id": 994, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13922:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + { + "id": 995, + "name": "data", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 982, + "src": "13925:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + { + "expression": { + "expression": { + "id": 996, + "name": "Enum", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1435, + "src": "13931:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_Enum_$1435_$", + "typeString": "type(contract Enum)" + } + }, + "id": 997, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "Operation", + "nodeType": "MemberAccess", + "referencedDeclaration": 1434, + "src": "13931:14:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Operation_$1434_$", + "typeString": "type(enum Enum.Operation)" + } + }, + "id": 998, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "Call", + "nodeType": "MemberAccess", + "src": "13931:19:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Operation_$1434", + "typeString": "enum Enum.Operation" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + }, + { + "typeIdentifier": "t_enum$_Operation_$1434", + "typeString": "enum Enum.Operation" + } + ], + "expression": { + "id": 991, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 952, + "src": "13884:4:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + }, + "id": 992, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "execTransactionFromModule", + "nodeType": "MemberAccess", + "referencedDeclaration": 17, + "src": "13884:30:0", + "typeDescriptions": { + "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$_t_bytes_memory_ptr_$_t_enum$_Operation_$1434_$returns$_t_bool_$", + "typeString": "function (address,uint256,bytes memory,enum Enum.Operation) external returns (bool)" + } + }, + "id": 999, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13884:67:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "hexValue": "436f756c64206e6f74206578656375746520746f6b656e207472616e73666572", + "id": 1000, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13953:34:0", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_00c0b742664159361be6aebbe2af44c4ae7eb95e13260265d1e1cf75d2593709", + "typeString": "literal_string \"Could not execute token transfer\"" + }, + "value": "Could not execute token transfer" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_00c0b742664159361be6aebbe2af44c4ae7eb95e13260265d1e1cf75d2593709", + "typeString": "literal_string \"Could not execute token transfer\"" + } + ], + "id": 990, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "13876:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1001, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13876:112:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1002, + "nodeType": "ExpressionStatement", + "src": "13876:112:0" + } + ] + }, + "id": 1004, + "nodeType": "IfStatement", + "src": "13539:460:0", + "trueBody": { + "id": 980, + "nodeType": "Block", + "src": "13564:194:0", + "statements": [ + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "id": 970, + "name": "to", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 956, + "src": "13674:2:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "id": 971, + "name": "amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 958, + "src": "13678:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + { + "hexValue": "", + "id": 972, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13686:2:0", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470", + "typeString": "literal_string \"\"" + }, + "value": "" + }, + { + "expression": { + "expression": { + "id": 973, + "name": "Enum", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1435, + "src": "13690:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_Enum_$1435_$", + "typeString": "type(contract Enum)" + } + }, + "id": 974, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "Operation", + "nodeType": "MemberAccess", + "referencedDeclaration": 1434, + "src": "13690:14:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Operation_$1434_$", + "typeString": "type(enum Enum.Operation)" + } + }, + "id": 975, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "Call", + "nodeType": "MemberAccess", + "src": "13690:19:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Operation_$1434", + "typeString": "enum Enum.Operation" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + { + "typeIdentifier": "t_stringliteral_c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470", + "typeString": "literal_string \"\"" + }, + { + "typeIdentifier": "t_enum$_Operation_$1434", + "typeString": "enum Enum.Operation" + } + ], + "expression": { + "id": 968, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 952, + "src": "13643:4:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + }, + "id": 969, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "execTransactionFromModule", + "nodeType": "MemberAccess", + "referencedDeclaration": 17, + "src": "13643:30:0", + "typeDescriptions": { + "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$_t_bytes_memory_ptr_$_t_enum$_Operation_$1434_$returns$_t_bool_$", + "typeString": "function (address,uint256,bytes memory,enum Enum.Operation) external returns (bool)" + } + }, + "id": 976, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13643:67:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "hexValue": "436f756c64206e6f742065786563757465206574686572207472616e73666572", + "id": 977, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13712:34:0", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_2fae53cac084168982e43888b6e5eff084959ab65d511777b56b4cbb265d2586", + "typeString": "literal_string \"Could not execute ether transfer\"" + }, + "value": "Could not execute ether transfer" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_2fae53cac084168982e43888b6e5eff084959ab65d511777b56b4cbb265d2586", + "typeString": "literal_string \"Could not execute ether transfer\"" + } + ], + "id": 967, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "13635:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 978, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13635:112:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 979, + "nodeType": "ExpressionStatement", + "src": "13635:112:0" + } + ] + } + } + ] + }, + "id": 1006, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "transfer", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 959, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 952, + "mutability": "mutable", + "name": "safe", + "nodeType": "VariableDeclaration", + "scope": 1006, + "src": "13454:15:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + }, + "typeName": { + "id": 951, + "name": "GnosisSafe", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 18, + "src": "13454:10:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 954, + "mutability": "mutable", + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 1006, + "src": "13471:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 953, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "13471:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 956, + "mutability": "mutable", + "name": "to", + "nodeType": "VariableDeclaration", + "scope": 1006, + "src": "13486:18:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + "typeName": { + "id": 955, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "13486:15:0", + "stateMutability": "payable", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 958, + "mutability": "mutable", + "name": "amount", + "nodeType": "VariableDeclaration", + "scope": 1006, + "src": "13506:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "typeName": { + "id": 957, + "name": "uint96", + "nodeType": "ElementaryTypeName", + "src": "13506:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "visibility": "internal" + } + ], + "src": "13453:67:0" + }, + "returnParameters": { + "id": 960, + "nodeType": "ParameterList", + "parameters": [], + "src": "13529:0:0" + }, + "scope": 1428, + "src": "13436:569:0", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "private" + }, + { + "body": { + "id": 1022, + "nodeType": "Block", + "src": "14101:46:0", + "statements": [ + { + "expression": { + "baseExpression": { + "baseExpression": { + "id": 1016, + "name": "tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 47, + "src": "14118:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_array$_t_address_$dyn_storage_$_$", + "typeString": "mapping(address => mapping(address => address[] storage ref))" + } + }, + "id": 1018, + "indexExpression": { + "id": 1017, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1008, + "src": "14125:4:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "14118:12:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_array$_t_address_$dyn_storage_$", + "typeString": "mapping(address => address[] storage ref)" + } + }, + "id": 1020, + "indexExpression": { + "id": 1019, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1010, + "src": "14131:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "14118:22:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "functionReturnParameters": 1015, + "id": 1021, + "nodeType": "Return", + "src": "14111:29:0" + } + ] + }, + "functionSelector": "8d0e8e1d", + "id": 1023, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getTokens", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1011, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1008, + "mutability": "mutable", + "name": "safe", + "nodeType": "VariableDeclaration", + "scope": 1023, + "src": "14030:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1007, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "14030:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1010, + "mutability": "mutable", + "name": "delegate", + "nodeType": "VariableDeclaration", + "scope": 1023, + "src": "14044:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1009, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "14044:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "14029:32:0" + }, + "returnParameters": { + "id": 1015, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1014, + "mutability": "mutable", + "name": "", + "nodeType": "VariableDeclaration", + "scope": 1023, + "src": "14083:16:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[]" + }, + "typeName": { + "baseType": { + "id": 1012, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "14083:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 1013, + "nodeType": "ArrayTypeName", + "src": "14083:9:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + } + }, + "visibility": "internal" + } + ], + "src": "14082:18:0" + }, + "scope": 1428, + "src": "14011:136:0", + "stateMutability": "view", + "virtual": false, + "visibility": "public" + }, + { + "body": { + "id": 1071, + "nodeType": "Block", + "src": "14267:313:0", + "statements": [ + { + "assignments": [ + 1037 + ], + "declarations": [ + { + "constant": false, + "id": 1037, + "mutability": "mutable", + "name": "allowance", + "nodeType": "VariableDeclaration", + "scope": 1071, + "src": "14277:26:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance" + }, + "typeName": { + "id": 1036, + "name": "Allowance", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 75, + "src": "14277:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_storage_ptr", + "typeString": "struct AllowanceModule.Allowance" + } + }, + "visibility": "internal" + } + ], + "id": 1043, + "initialValue": { + "arguments": [ + { + "id": 1039, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1025, + "src": "14319:4:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 1040, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1027, + "src": "14325:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 1041, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1029, + "src": "14335:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 1038, + "name": "getAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 360, + "src": "14306:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_address_$_t_address_$_t_address_$returns$_t_struct$_Allowance_$75_memory_ptr_$", + "typeString": "function (address,address,address) view returns (struct AllowanceModule.Allowance memory)" + } + }, + "id": 1042, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "14306:35:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "14277:64:0" + }, + { + "expression": { + "components": [ + { + "arguments": [ + { + "expression": { + "id": 1046, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1037, + "src": "14380:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 1047, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "amount", + "nodeType": "MemberAccess", + "referencedDeclaration": 66, + "src": "14380:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + ], + "id": 1045, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "14372:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + }, + "typeName": { + "id": 1044, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "14372:7:0", + "typeDescriptions": {} + } + }, + "id": 1048, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "14372:25:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "arguments": [ + { + "expression": { + "id": 1051, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1037, + "src": "14419:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 1052, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "spent", + "nodeType": "MemberAccess", + "referencedDeclaration": 68, + "src": "14419:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + ], + "id": 1050, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "14411:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + }, + "typeName": { + "id": 1049, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "14411:7:0", + "typeDescriptions": {} + } + }, + "id": 1053, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "14411:24:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "arguments": [ + { + "expression": { + "id": 1056, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1037, + "src": "14457:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 1057, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "resetTimeMin", + "nodeType": "MemberAccess", + "referencedDeclaration": 70, + "src": "14457:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + ], + "id": 1055, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "14449:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + }, + "typeName": { + "id": 1054, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "14449:7:0", + "typeDescriptions": {} + } + }, + "id": 1058, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "14449:31:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "arguments": [ + { + "expression": { + "id": 1061, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1037, + "src": "14502:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 1062, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "lastResetMin", + "nodeType": "MemberAccess", + "referencedDeclaration": 72, + "src": "14502:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + ], + "id": 1060, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "14494:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + }, + "typeName": { + "id": 1059, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "14494:7:0", + "typeDescriptions": {} + } + }, + "id": 1063, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "14494:31:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "arguments": [ + { + "expression": { + "id": 1066, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1037, + "src": "14547:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 1067, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "nonce", + "nodeType": "MemberAccess", + "referencedDeclaration": 74, + "src": "14547:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + ], + "id": 1065, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "14539:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + }, + "typeName": { + "id": 1064, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "14539:7:0", + "typeDescriptions": {} + } + }, + "id": 1068, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "14539:24:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 1069, + "isConstant": false, + "isInlineArray": true, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "14358:215:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$5_memory_ptr", + "typeString": "uint256[5] memory" + } + }, + "functionReturnParameters": 1035, + "id": 1070, + "nodeType": "Return", + "src": "14351:222:0" + } + ] + }, + "functionSelector": "94b31fbd", + "id": 1072, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getTokenAllowance", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1030, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1025, + "mutability": "mutable", + "name": "safe", + "nodeType": "VariableDeclaration", + "scope": 1072, + "src": "14180:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1024, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "14180:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1027, + "mutability": "mutable", + "name": "delegate", + "nodeType": "VariableDeclaration", + "scope": 1072, + "src": "14194:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1026, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "14194:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1029, + "mutability": "mutable", + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 1072, + "src": "14212:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1028, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "14212:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "14179:47:0" + }, + "returnParameters": { + "id": 1035, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1034, + "mutability": "mutable", + "name": "", + "nodeType": "VariableDeclaration", + "scope": 1072, + "src": "14248:17:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$5_memory_ptr", + "typeString": "uint256[5]" + }, + "typeName": { + "baseType": { + "id": 1031, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "14248:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 1033, + "length": { + "hexValue": "35", + "id": 1032, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "14256:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_5_by_1", + "typeString": "int_const 5" + }, + "value": "5" + }, + "nodeType": "ArrayTypeName", + "src": "14248:10:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$5_storage_ptr", + "typeString": "uint256[5]" + } + }, + "visibility": "internal" + } + ], + "src": "14247:19:0" + }, + "scope": 1428, + "src": "14153:427:0", + "stateMutability": "view", + "virtual": false, + "visibility": "public" + }, + { + "body": { + "id": 1164, + "nodeType": "Block", + "src": "14726:727:0", + "statements": [ + { + "assignments": [ + 1079 + ], + "declarations": [ + { + "constant": false, + "id": 1079, + "mutability": "mutable", + "name": "index", + "nodeType": "VariableDeclaration", + "scope": 1164, + "src": "14736:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + }, + "typeName": { + "id": 1078, + "name": "uint48", + "nodeType": "ElementaryTypeName", + "src": "14736:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "visibility": "internal" + } + ], + "id": 1084, + "initialValue": { + "arguments": [ + { + "id": 1082, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1075, + "src": "14758:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 1081, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "14751:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint48_$", + "typeString": "type(uint48)" + }, + "typeName": { + "id": 1080, + "name": "uint48", + "nodeType": "ElementaryTypeName", + "src": "14751:6:0", + "typeDescriptions": {} + } + }, + "id": 1083, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "14751:16:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "14736:31:0" + }, + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 1091, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 1086, + "name": "index", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1079, + "src": "14785:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "arguments": [ + { + "hexValue": "30", + "id": 1089, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "14799:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 1088, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "14794:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + }, + "typeName": { + "id": 1087, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "14794:4:0", + "typeDescriptions": {} + } + }, + "id": 1090, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "14794:7:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "14785:16:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "hexValue": "696e64657820213d2075696e74283029", + "id": 1092, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "14803:18:0", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_4a2d9edd74f24662f88947ce284e3a1e9e02725c0905850305b1ce7e8ee456f2", + "typeString": "literal_string \"index != uint(0)\"" + }, + "value": "index != uint(0)" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_4a2d9edd74f24662f88947ce284e3a1e9e02725c0905850305b1ce7e8ee456f2", + "typeString": "literal_string \"index != uint(0)\"" + } + ], + "id": 1085, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "14777:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1093, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "14777:45:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1094, + "nodeType": "ExpressionStatement", + "src": "14777:45:0" + }, + { + "assignments": [ + 1096 + ], + "declarations": [ + { + "constant": false, + "id": 1096, + "mutability": "mutable", + "name": "currentDelegate", + "nodeType": "VariableDeclaration", + "scope": 1164, + "src": "14832:23:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1095, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "14832:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "id": 1104, + "initialValue": { + "expression": { + "baseExpression": { + "baseExpression": { + "id": 1097, + "name": "delegates", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 57, + "src": "14858:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_uint48_$_t_struct$_Delegate_$64_storage_$_$", + "typeString": "mapping(address => mapping(uint48 => struct AllowanceModule.Delegate storage ref))" + } + }, + "id": 1100, + "indexExpression": { + "expression": { + "id": 1098, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "14868:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1099, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "14868:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "14858:21:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint48_$_t_struct$_Delegate_$64_storage_$", + "typeString": "mapping(uint48 => struct AllowanceModule.Delegate storage ref)" + } + }, + "id": 1102, + "indexExpression": { + "id": 1101, + "name": "index", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1079, + "src": "14880:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "14858:28:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$64_storage", + "typeString": "struct AllowanceModule.Delegate storage ref" + } + }, + "id": 1103, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "delegate", + "nodeType": "MemberAccess", + "referencedDeclaration": 59, + "src": "14858:37:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "14832:63:0" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 1110, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 1105, + "name": "currentDelegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1096, + "src": "14908:15:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "arguments": [ + { + "hexValue": "30", + "id": 1108, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "14935:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 1107, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "14927:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 1106, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "14927:7:0", + "typeDescriptions": {} + } + }, + "id": 1109, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "14927:10:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "src": "14908:29:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 1120, + "nodeType": "IfStatement", + "src": "14905:264:0", + "trueBody": { + "id": 1119, + "nodeType": "Block", + "src": "14939:230:0", + "statements": [ + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 1114, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 1112, + "name": "currentDelegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1096, + "src": "15025:15:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "id": 1113, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1075, + "src": "15044:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "15025:27:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "hexValue": "63757272656e7444656c6567617465203d3d2064656c6567617465", + "id": 1115, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "15054:29:0", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_015a46159767c793786ac6026f0bf920b0e1b83347241b23bbb8e98c67f949b3", + "typeString": "literal_string \"currentDelegate == delegate\"" + }, + "value": "currentDelegate == delegate" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_015a46159767c793786ac6026f0bf920b0e1b83347241b23bbb8e98c67f949b3", + "typeString": "literal_string \"currentDelegate == delegate\"" + } + ], + "id": 1111, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "15017:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1116, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "15017:67:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1117, + "nodeType": "ExpressionStatement", + "src": "15017:67:0" + }, + { + "functionReturnParameters": 1077, + "id": 1118, + "nodeType": "Return", + "src": "15152:7:0" + } + ] + } + }, + { + "assignments": [ + 1122 + ], + "declarations": [ + { + "constant": false, + "id": 1122, + "mutability": "mutable", + "name": "startIndex", + "nodeType": "VariableDeclaration", + "scope": 1164, + "src": "15178:17:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + }, + "typeName": { + "id": 1121, + "name": "uint48", + "nodeType": "ElementaryTypeName", + "src": "15178:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "visibility": "internal" + } + ], + "id": 1127, + "initialValue": { + "baseExpression": { + "id": 1123, + "name": "delegatesStart", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 51, + "src": "15198:14:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint48_$", + "typeString": "mapping(address => uint48)" + } + }, + "id": 1126, + "indexExpression": { + "expression": { + "id": 1124, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "15213:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1125, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "15213:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "15198:26:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "15178:46:0" + }, + { + "expression": { + "id": 1139, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "baseExpression": { + "baseExpression": { + "id": 1128, + "name": "delegates", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 57, + "src": "15234:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_uint48_$_t_struct$_Delegate_$64_storage_$_$", + "typeString": "mapping(address => mapping(uint48 => struct AllowanceModule.Delegate storage ref))" + } + }, + "id": 1132, + "indexExpression": { + "expression": { + "id": 1129, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "15244:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1130, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "15244:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "15234:21:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint48_$_t_struct$_Delegate_$64_storage_$", + "typeString": "mapping(uint48 => struct AllowanceModule.Delegate storage ref)" + } + }, + "id": 1133, + "indexExpression": { + "id": 1131, + "name": "index", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1079, + "src": "15256:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "15234:28:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$64_storage", + "typeString": "struct AllowanceModule.Delegate storage ref" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "id": 1135, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1075, + "src": "15274:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "hexValue": "30", + "id": 1136, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "15284:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + { + "id": 1137, + "name": "startIndex", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1122, + "src": "15287:10:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + ], + "id": 1134, + "name": "Delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 64, + "src": "15265:8:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_struct$_Delegate_$64_storage_ptr_$", + "typeString": "type(struct AllowanceModule.Delegate storage pointer)" + } + }, + "id": 1138, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "structConstructorCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "15265:33:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$64_memory_ptr", + "typeString": "struct AllowanceModule.Delegate memory" + } + }, + "src": "15234:64:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$64_storage", + "typeString": "struct AllowanceModule.Delegate storage ref" + } + }, + "id": 1140, + "nodeType": "ExpressionStatement", + "src": "15234:64:0" + }, + { + "expression": { + "id": 1149, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "baseExpression": { + "baseExpression": { + "id": 1141, + "name": "delegates", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 57, + "src": "15308:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_uint48_$_t_struct$_Delegate_$64_storage_$_$", + "typeString": "mapping(address => mapping(uint48 => struct AllowanceModule.Delegate storage ref))" + } + }, + "id": 1145, + "indexExpression": { + "expression": { + "id": 1142, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "15318:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1143, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "15318:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "15308:21:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint48_$_t_struct$_Delegate_$64_storage_$", + "typeString": "mapping(uint48 => struct AllowanceModule.Delegate storage ref)" + } + }, + "id": 1146, + "indexExpression": { + "id": 1144, + "name": "startIndex", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1122, + "src": "15330:10:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "15308:33:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$64_storage", + "typeString": "struct AllowanceModule.Delegate storage ref" + } + }, + "id": 1147, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "prev", + "nodeType": "MemberAccess", + "referencedDeclaration": 61, + "src": "15308:38:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "id": 1148, + "name": "index", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1079, + "src": "15349:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "src": "15308:46:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "id": 1150, + "nodeType": "ExpressionStatement", + "src": "15308:46:0" + }, + { + "expression": { + "id": 1156, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "baseExpression": { + "id": 1151, + "name": "delegatesStart", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 51, + "src": "15364:14:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint48_$", + "typeString": "mapping(address => uint48)" + } + }, + "id": 1154, + "indexExpression": { + "expression": { + "id": 1152, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "15379:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1153, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "15379:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "15364:26:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "id": 1155, + "name": "index", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1079, + "src": "15393:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "src": "15364:34:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "id": 1157, + "nodeType": "ExpressionStatement", + "src": "15364:34:0" + }, + { + "eventCall": { + "arguments": [ + { + "expression": { + "id": 1159, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "15425:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1160, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "15425:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "id": 1161, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1075, + "src": "15437:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 1158, + "name": "AddDelegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 81, + "src": "15413:11:0", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$returns$__$", + "typeString": "function (address,address)" + } + }, + "id": 1162, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "15413:33:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1163, + "nodeType": "EmitStatement", + "src": "15408:38:0" + } + ] + }, + "documentation": { + "id": 1073, + "nodeType": "StructuredDocumentation", + "src": "14586:89:0", + "text": "@dev Allows to add a delegate.\n @param delegate Delegate that should be added." + }, + "functionSelector": "e71bdf41", + "id": 1165, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "addDelegate", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1076, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1075, + "mutability": "mutable", + "name": "delegate", + "nodeType": "VariableDeclaration", + "scope": 1165, + "src": "14701:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1074, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "14701:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "14700:18:0" + }, + "returnParameters": { + "id": 1077, + "nodeType": "ParameterList", + "parameters": [], + "src": "14726:0:0" + }, + "scope": 1428, + "src": "14680:773:0", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "public" + }, + { + "body": { + "id": 1338, + "nodeType": "Block", + "src": "15853:1293:0", + "statements": [ + { + "assignments": [ + 1174 + ], + "declarations": [ + { + "constant": false, + "id": 1174, + "mutability": "mutable", + "name": "current", + "nodeType": "VariableDeclaration", + "scope": 1338, + "src": "15863:23:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$64_memory_ptr", + "typeString": "struct AllowanceModule.Delegate" + }, + "typeName": { + "id": 1173, + "name": "Delegate", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 64, + "src": "15863:8:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$64_storage_ptr", + "typeString": "struct AllowanceModule.Delegate" + } + }, + "visibility": "internal" + } + ], + "id": 1184, + "initialValue": { + "baseExpression": { + "baseExpression": { + "id": 1175, + "name": "delegates", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 57, + "src": "15889:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_uint48_$_t_struct$_Delegate_$64_storage_$_$", + "typeString": "mapping(address => mapping(uint48 => struct AllowanceModule.Delegate storage ref))" + } + }, + "id": 1178, + "indexExpression": { + "expression": { + "id": 1176, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "15899:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1177, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "15899:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "15889:21:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint48_$_t_struct$_Delegate_$64_storage_$", + "typeString": "mapping(uint48 => struct AllowanceModule.Delegate storage ref)" + } + }, + "id": 1183, + "indexExpression": { + "arguments": [ + { + "id": 1181, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1168, + "src": "15918:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 1180, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "15911:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint48_$", + "typeString": "type(uint48)" + }, + "typeName": { + "id": 1179, + "name": "uint48", + "nodeType": "ElementaryTypeName", + "src": "15911:6:0", + "typeDescriptions": {} + } + }, + "id": 1182, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "15911:16:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "15889:39:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$64_storage", + "typeString": "struct AllowanceModule.Delegate storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "15863:65:0" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 1191, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 1185, + "name": "current", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1174, + "src": "15991:7:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$64_memory_ptr", + "typeString": "struct AllowanceModule.Delegate memory" + } + }, + "id": 1186, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "delegate", + "nodeType": "MemberAccess", + "referencedDeclaration": 59, + "src": "15991:16:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "arguments": [ + { + "hexValue": "30", + "id": 1189, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "16019:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 1188, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "16011:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 1187, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "16011:7:0", + "typeDescriptions": {} + } + }, + "id": 1190, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "16011:10:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "src": "15991:30:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 1193, + "nodeType": "IfStatement", + "src": "15988:42:0", + "trueBody": { + "functionReturnParameters": 1172, + "id": 1192, + "nodeType": "Return", + "src": "16023:7:0" + } + }, + { + "condition": { + "id": 1194, + "name": "removeAllowances", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1170, + "src": "16043:16:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 1275, + "nodeType": "IfStatement", + "src": "16039:698:0", + "trueBody": { + "id": 1274, + "nodeType": "Block", + "src": "16061:676:0", + "statements": [ + { + "assignments": [ + 1199 + ], + "declarations": [ + { + "constant": false, + "id": 1199, + "mutability": "mutable", + "name": "delegateTokens", + "nodeType": "VariableDeclaration", + "scope": 1274, + "src": "16075:32:0", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + }, + "typeName": { + "baseType": { + "id": 1197, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "16075:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 1198, + "nodeType": "ArrayTypeName", + "src": "16075:9:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + } + }, + "visibility": "internal" + } + ], + "id": 1206, + "initialValue": { + "baseExpression": { + "baseExpression": { + "id": 1200, + "name": "tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 47, + "src": "16110:6:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_array$_t_address_$dyn_storage_$_$", + "typeString": "mapping(address => mapping(address => address[] storage ref))" + } + }, + "id": 1203, + "indexExpression": { + "expression": { + "id": 1201, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "16117:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1202, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "16117:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "16110:18:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_array$_t_address_$dyn_storage_$", + "typeString": "mapping(address => address[] storage ref)" + } + }, + "id": 1205, + "indexExpression": { + "id": 1204, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1168, + "src": "16129:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "16110:28:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "16075:63:0" + }, + { + "body": { + "id": 1272, + "nodeType": "Block", + "src": "16204:523:0", + "statements": [ + { + "assignments": [ + 1219 + ], + "declarations": [ + { + "constant": false, + "id": 1219, + "mutability": "mutable", + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 1272, + "src": "16222:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1218, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "16222:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "id": 1223, + "initialValue": { + "baseExpression": { + "id": 1220, + "name": "delegateTokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1199, + "src": "16238:14:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[] storage pointer" + } + }, + "id": 1222, + "indexExpression": { + "id": 1221, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1208, + "src": "16253:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "16238:17:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "16222:33:0" + }, + { + "assignments": [ + 1225 + ], + "declarations": [ + { + "constant": false, + "id": 1225, + "mutability": "mutable", + "name": "allowance", + "nodeType": "VariableDeclaration", + "scope": 1272, + "src": "16339:26:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance" + }, + "typeName": { + "id": 1224, + "name": "Allowance", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 75, + "src": "16339:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_storage_ptr", + "typeString": "struct AllowanceModule.Allowance" + } + }, + "visibility": "internal" + } + ], + "id": 1232, + "initialValue": { + "arguments": [ + { + "expression": { + "id": 1227, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "16381:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1228, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "16381:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "id": 1229, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1168, + "src": "16393:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 1230, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1219, + "src": "16403:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 1226, + "name": "getAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 360, + "src": "16368:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_address_$_t_address_$_t_address_$returns$_t_struct$_Allowance_$75_memory_ptr_$", + "typeString": "function (address,address,address) view returns (struct AllowanceModule.Allowance memory)" + } + }, + "id": 1231, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "16368:41:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "16339:70:0" + }, + { + "expression": { + "id": 1237, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 1233, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1225, + "src": "16427:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 1235, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "amount", + "nodeType": "MemberAccess", + "referencedDeclaration": 66, + "src": "16427:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "hexValue": "30", + "id": 1236, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "16446:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "16427:20:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "id": 1238, + "nodeType": "ExpressionStatement", + "src": "16427:20:0" + }, + { + "expression": { + "id": 1243, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 1239, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1225, + "src": "16465:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 1241, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "spent", + "nodeType": "MemberAccess", + "referencedDeclaration": 68, + "src": "16465:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "hexValue": "30", + "id": 1242, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "16483:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "16465:19:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "id": 1244, + "nodeType": "ExpressionStatement", + "src": "16465:19:0" + }, + { + "expression": { + "id": 1249, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 1245, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1225, + "src": "16502:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 1247, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "resetTimeMin", + "nodeType": "MemberAccess", + "referencedDeclaration": 70, + "src": "16502:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "hexValue": "30", + "id": 1248, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "16527:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "16502:26:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "id": 1250, + "nodeType": "ExpressionStatement", + "src": "16502:26:0" + }, + { + "expression": { + "id": 1255, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 1251, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1225, + "src": "16546:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 1253, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "lastResetMin", + "nodeType": "MemberAccess", + "referencedDeclaration": 72, + "src": "16546:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "hexValue": "30", + "id": 1254, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "16571:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "16546:26:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "id": 1256, + "nodeType": "ExpressionStatement", + "src": "16546:26:0" + }, + { + "expression": { + "arguments": [ + { + "expression": { + "id": 1258, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "16606:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1259, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "16606:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "id": 1260, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1168, + "src": "16618:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 1261, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1219, + "src": "16628:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 1262, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1225, + "src": "16635:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_struct$_Allowance_$75_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + ], + "id": 1257, + "name": "updateAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 382, + "src": "16590:15:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_address_$_t_struct$_Allowance_$75_memory_ptr_$returns$__$", + "typeString": "function (address,address,address,struct AllowanceModule.Allowance memory)" + } + }, + "id": 1263, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "16590:55:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1264, + "nodeType": "ExpressionStatement", + "src": "16590:55:0" + }, + { + "eventCall": { + "arguments": [ + { + "expression": { + "id": 1266, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "16684:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1267, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "16684:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "id": 1268, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1168, + "src": "16696:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 1269, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1219, + "src": "16706:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 1265, + "name": "DeleteAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 141, + "src": "16668:15:0", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_address_$returns$__$", + "typeString": "function (address,address,address)" + } + }, + "id": 1270, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "16668:44:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1271, + "nodeType": "EmitStatement", + "src": "16663:49:0" + } + ] + }, + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 1214, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 1211, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1208, + "src": "16172:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "expression": { + "id": 1212, + "name": "delegateTokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1199, + "src": "16176:14:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[] storage pointer" + } + }, + "id": 1213, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "length", + "nodeType": "MemberAccess", + "src": "16176:21:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "16172:25:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 1273, + "initializationExpression": { + "assignments": [ + 1208 + ], + "declarations": [ + { + "constant": false, + "id": 1208, + "mutability": "mutable", + "name": "i", + "nodeType": "VariableDeclaration", + "scope": 1273, + "src": "16157:9:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1207, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "16157:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 1210, + "initialValue": { + "hexValue": "30", + "id": 1209, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "16169:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "nodeType": "VariableDeclarationStatement", + "src": "16157:13:0" + }, + "loopExpression": { + "expression": { + "id": 1216, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "16199:3:0", + "subExpression": { + "id": 1215, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1208, + "src": "16199:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 1217, + "nodeType": "ExpressionStatement", + "src": "16199:3:0" + }, + "nodeType": "ForStatement", + "src": "16152:575:0" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + }, + "id": 1279, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 1276, + "name": "current", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1174, + "src": "16750:7:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$64_memory_ptr", + "typeString": "struct AllowanceModule.Delegate memory" + } + }, + "id": 1277, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "prev", + "nodeType": "MemberAccess", + "referencedDeclaration": 61, + "src": "16750:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "30", + "id": 1278, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "16766:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "16750:17:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "id": 1301, + "nodeType": "Block", + "src": "16841:80:0", + "statements": [ + { + "expression": { + "id": 1299, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "baseExpression": { + "baseExpression": { + "id": 1289, + "name": "delegates", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 57, + "src": "16855:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_uint48_$_t_struct$_Delegate_$64_storage_$_$", + "typeString": "mapping(address => mapping(uint48 => struct AllowanceModule.Delegate storage ref))" + } + }, + "id": 1294, + "indexExpression": { + "expression": { + "id": 1290, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "16865:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1291, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "16865:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "16855:21:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint48_$_t_struct$_Delegate_$64_storage_$", + "typeString": "mapping(uint48 => struct AllowanceModule.Delegate storage ref)" + } + }, + "id": 1295, + "indexExpression": { + "expression": { + "id": 1292, + "name": "current", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1174, + "src": "16877:7:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$64_memory_ptr", + "typeString": "struct AllowanceModule.Delegate memory" + } + }, + "id": 1293, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "prev", + "nodeType": "MemberAccess", + "referencedDeclaration": 61, + "src": "16877:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "16855:35:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$64_storage", + "typeString": "struct AllowanceModule.Delegate storage ref" + } + }, + "id": 1296, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "next", + "nodeType": "MemberAccess", + "referencedDeclaration": 63, + "src": "16855:40:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "expression": { + "id": 1297, + "name": "current", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1174, + "src": "16898:7:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$64_memory_ptr", + "typeString": "struct AllowanceModule.Delegate memory" + } + }, + "id": 1298, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "next", + "nodeType": "MemberAccess", + "referencedDeclaration": 63, + "src": "16898:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "src": "16855:55:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "id": 1300, + "nodeType": "ExpressionStatement", + "src": "16855:55:0" + } + ] + }, + "id": 1302, + "nodeType": "IfStatement", + "src": "16746:175:0", + "trueBody": { + "id": 1288, + "nodeType": "Block", + "src": "16769:66:0", + "statements": [ + { + "expression": { + "id": 1286, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "baseExpression": { + "id": 1280, + "name": "delegatesStart", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 51, + "src": "16783:14:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint48_$", + "typeString": "mapping(address => uint48)" + } + }, + "id": 1283, + "indexExpression": { + "expression": { + "id": 1281, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "16798:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1282, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "16798:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "16783:26:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "expression": { + "id": 1284, + "name": "current", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1174, + "src": "16812:7:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$64_memory_ptr", + "typeString": "struct AllowanceModule.Delegate memory" + } + }, + "id": 1285, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "next", + "nodeType": "MemberAccess", + "referencedDeclaration": 63, + "src": "16812:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "src": "16783:41:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "id": 1287, + "nodeType": "ExpressionStatement", + "src": "16783:41:0" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + }, + "id": 1306, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 1303, + "name": "current", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1174, + "src": "16934:7:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$64_memory_ptr", + "typeString": "struct AllowanceModule.Delegate memory" + } + }, + "id": 1304, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "next", + "nodeType": "MemberAccess", + "referencedDeclaration": 63, + "src": "16934:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "hexValue": "30", + "id": 1305, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "16950:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "16934:17:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 1320, + "nodeType": "IfStatement", + "src": "16930:103:0", + "trueBody": { + "id": 1319, + "nodeType": "Block", + "src": "16953:80:0", + "statements": [ + { + "expression": { + "id": 1317, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "baseExpression": { + "baseExpression": { + "id": 1307, + "name": "delegates", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 57, + "src": "16967:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_uint48_$_t_struct$_Delegate_$64_storage_$_$", + "typeString": "mapping(address => mapping(uint48 => struct AllowanceModule.Delegate storage ref))" + } + }, + "id": 1312, + "indexExpression": { + "expression": { + "id": 1308, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "16977:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1309, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "16977:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "16967:21:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint48_$_t_struct$_Delegate_$64_storage_$", + "typeString": "mapping(uint48 => struct AllowanceModule.Delegate storage ref)" + } + }, + "id": 1313, + "indexExpression": { + "expression": { + "id": 1310, + "name": "current", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1174, + "src": "16989:7:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$64_memory_ptr", + "typeString": "struct AllowanceModule.Delegate memory" + } + }, + "id": 1311, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "next", + "nodeType": "MemberAccess", + "referencedDeclaration": 63, + "src": "16989:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "16967:35:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$64_storage", + "typeString": "struct AllowanceModule.Delegate storage ref" + } + }, + "id": 1314, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "prev", + "nodeType": "MemberAccess", + "referencedDeclaration": 61, + "src": "16967:40:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "expression": { + "id": 1315, + "name": "current", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1174, + "src": "17010:7:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$64_memory_ptr", + "typeString": "struct AllowanceModule.Delegate memory" + } + }, + "id": 1316, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "prev", + "nodeType": "MemberAccess", + "referencedDeclaration": 61, + "src": "17010:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "src": "16967:55:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "id": 1318, + "nodeType": "ExpressionStatement", + "src": "16967:55:0" + } + ] + } + }, + { + "expression": { + "id": 1330, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "delete", + "prefix": true, + "src": "17042:46:0", + "subExpression": { + "baseExpression": { + "baseExpression": { + "id": 1321, + "name": "delegates", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 57, + "src": "17049:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_uint48_$_t_struct$_Delegate_$64_storage_$_$", + "typeString": "mapping(address => mapping(uint48 => struct AllowanceModule.Delegate storage ref))" + } + }, + "id": 1324, + "indexExpression": { + "expression": { + "id": 1322, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "17059:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1323, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "17059:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "17049:21:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint48_$_t_struct$_Delegate_$64_storage_$", + "typeString": "mapping(uint48 => struct AllowanceModule.Delegate storage ref)" + } + }, + "id": 1329, + "indexExpression": { + "arguments": [ + { + "id": 1327, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1168, + "src": "17078:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 1326, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "17071:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint48_$", + "typeString": "type(uint48)" + }, + "typeName": { + "id": 1325, + "name": "uint48", + "nodeType": "ElementaryTypeName", + "src": "17071:6:0", + "typeDescriptions": {} + } + }, + "id": 1328, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "17071:16:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "17049:39:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$64_storage", + "typeString": "struct AllowanceModule.Delegate storage ref" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1331, + "nodeType": "ExpressionStatement", + "src": "17042:46:0" + }, + { + "eventCall": { + "arguments": [ + { + "expression": { + "id": 1333, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -15, + "src": "17118:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1334, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "17118:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "id": 1335, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1168, + "src": "17130:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 1332, + "name": "RemoveDelegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 87, + "src": "17103:14:0", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$returns$__$", + "typeString": "function (address,address)" + } + }, + "id": 1336, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "17103:36:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1337, + "nodeType": "EmitStatement", + "src": "17098:41:0" + } + ] + }, + "documentation": { + "id": 1166, + "nodeType": "StructuredDocumentation", + "src": "15459:317:0", + "text": "@dev Allows to remove a delegate.\n @param delegate Delegate that should be removed.\n @param removeAllowances Indicator if allowances should also be removed. This should be set to `true` unless this causes an out of gas, in this case the allowances should be \"manually\" deleted via `deleteAllowance`." + }, + "functionSelector": "dd43a79f", + "id": 1339, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "removeDelegate", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1171, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1168, + "mutability": "mutable", + "name": "delegate", + "nodeType": "VariableDeclaration", + "scope": 1339, + "src": "15805:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1167, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "15805:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1170, + "mutability": "mutable", + "name": "removeAllowances", + "nodeType": "VariableDeclaration", + "scope": 1339, + "src": "15823:21:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 1169, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "15823:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "15804:41:0" + }, + "returnParameters": { + "id": 1172, + "nodeType": "ParameterList", + "parameters": [], + "src": "15853:0:0" + }, + "scope": 1428, + "src": "15781:1365:0", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "public" + }, + { + "body": { + "id": 1426, + "nodeType": "Block", + "src": "17278:633:0", + "statements": [ + { + "expression": { + "id": 1359, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 1353, + "name": "results", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1349, + "src": "17288:7:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "id": 1357, + "name": "pageSize", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1345, + "src": "17312:8:0", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + ], + "id": 1356, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "NewExpression", + "src": "17298:13:0", + "typeDescriptions": { + "typeIdentifier": "t_function_objectcreation_pure$_t_uint256_$returns$_t_array$_t_address_$dyn_memory_ptr_$", + "typeString": "function (uint256) pure returns (address[] memory)" + }, + "typeName": { + "baseType": { + "id": 1354, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "17302:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 1355, + "nodeType": "ArrayTypeName", + "src": "17302:9:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + } + } + }, + "id": 1358, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "17298:23:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + "src": "17288:33:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + "id": 1360, + "nodeType": "ExpressionStatement", + "src": "17288:33:0" + }, + { + "assignments": [ + 1362 + ], + "declarations": [ + { + "constant": false, + "id": 1362, + "mutability": "mutable", + "name": "i", + "nodeType": "VariableDeclaration", + "scope": 1426, + "src": "17331:7:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "typeName": { + "id": 1361, + "name": "uint8", + "nodeType": "ElementaryTypeName", + "src": "17331:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "visibility": "internal" + } + ], + "id": 1364, + "initialValue": { + "hexValue": "30", + "id": 1363, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "17341:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "nodeType": "VariableDeclarationStatement", + "src": "17331:11:0" + }, + { + "assignments": [ + 1366 + ], + "declarations": [ + { + "constant": false, + "id": 1366, + "mutability": "mutable", + "name": "initialIndex", + "nodeType": "VariableDeclaration", + "scope": 1426, + "src": "17352:19:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + }, + "typeName": { + "id": 1365, + "name": "uint48", + "nodeType": "ElementaryTypeName", + "src": "17352:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "visibility": "internal" + } + ], + "id": 1376, + "initialValue": { + "condition": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + }, + "id": 1369, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 1367, + "name": "start", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1343, + "src": "17375:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "hexValue": "30", + "id": 1368, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "17384:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "17375:10:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "id": 1370, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "17374:12:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseExpression": { + "baseExpression": { + "id": 1372, + "name": "delegatesStart", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 51, + "src": "17397:14:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint48_$", + "typeString": "mapping(address => uint48)" + } + }, + "id": 1374, + "indexExpression": { + "id": 1373, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1341, + "src": "17412:4:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "17397:20:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "id": 1375, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "Conditional", + "src": "17374:43:0", + "trueExpression": { + "id": 1371, + "name": "start", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1343, + "src": "17389:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "17352:65:0" + }, + { + "assignments": [ + 1378 + ], + "declarations": [ + { + "constant": false, + "id": 1378, + "mutability": "mutable", + "name": "current", + "nodeType": "VariableDeclaration", + "scope": 1426, + "src": "17427:23:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$64_memory_ptr", + "typeString": "struct AllowanceModule.Delegate" + }, + "typeName": { + "id": 1377, + "name": "Delegate", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 64, + "src": "17427:8:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$64_storage_ptr", + "typeString": "struct AllowanceModule.Delegate" + } + }, + "visibility": "internal" + } + ], + "id": 1384, + "initialValue": { + "baseExpression": { + "baseExpression": { + "id": 1379, + "name": "delegates", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 57, + "src": "17453:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_uint48_$_t_struct$_Delegate_$64_storage_$_$", + "typeString": "mapping(address => mapping(uint48 => struct AllowanceModule.Delegate storage ref))" + } + }, + "id": 1381, + "indexExpression": { + "id": 1380, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1341, + "src": "17463:4:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "17453:15:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint48_$_t_struct$_Delegate_$64_storage_$", + "typeString": "mapping(uint48 => struct AllowanceModule.Delegate storage ref)" + } + }, + "id": 1383, + "indexExpression": { + "id": 1382, + "name": "initialIndex", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1366, + "src": "17469:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "17453:29:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$64_storage", + "typeString": "struct AllowanceModule.Delegate storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "17427:55:0" + }, + { + "body": { + "id": 1415, + "nodeType": "Block", + "src": "17546:124:0", + "statements": [ + { + "expression": { + "id": 1401, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "baseExpression": { + "id": 1396, + "name": "results", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1349, + "src": "17560:7:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + "id": 1398, + "indexExpression": { + "id": 1397, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1362, + "src": "17568:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "17560:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "expression": { + "id": 1399, + "name": "current", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1378, + "src": "17573:7:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$64_memory_ptr", + "typeString": "struct AllowanceModule.Delegate memory" + } + }, + "id": 1400, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "delegate", + "nodeType": "MemberAccess", + "referencedDeclaration": 59, + "src": "17573:16:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "17560:29:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 1402, + "nodeType": "ExpressionStatement", + "src": "17560:29:0" + }, + { + "expression": { + "id": 1404, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "17603:3:0", + "subExpression": { + "id": 1403, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1362, + "src": "17603:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "id": 1405, + "nodeType": "ExpressionStatement", + "src": "17603:3:0" + }, + { + "expression": { + "id": 1413, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 1406, + "name": "current", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1378, + "src": "17620:7:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$64_memory_ptr", + "typeString": "struct AllowanceModule.Delegate memory" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "baseExpression": { + "baseExpression": { + "id": 1407, + "name": "delegates", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 57, + "src": "17630:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_uint48_$_t_struct$_Delegate_$64_storage_$_$", + "typeString": "mapping(address => mapping(uint48 => struct AllowanceModule.Delegate storage ref))" + } + }, + "id": 1409, + "indexExpression": { + "id": 1408, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1341, + "src": "17640:4:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "17630:15:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint48_$_t_struct$_Delegate_$64_storage_$", + "typeString": "mapping(uint48 => struct AllowanceModule.Delegate storage ref)" + } + }, + "id": 1412, + "indexExpression": { + "expression": { + "id": 1410, + "name": "current", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1378, + "src": "17646:7:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$64_memory_ptr", + "typeString": "struct AllowanceModule.Delegate memory" + } + }, + "id": 1411, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "next", + "nodeType": "MemberAccess", + "referencedDeclaration": 63, + "src": "17646:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "17630:29:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$64_storage", + "typeString": "struct AllowanceModule.Delegate storage ref" + } + }, + "src": "17620:39:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$64_memory_ptr", + "typeString": "struct AllowanceModule.Delegate memory" + } + }, + "id": 1414, + "nodeType": "ExpressionStatement", + "src": "17620:39:0" + } + ] + }, + "condition": { + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 1395, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 1391, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 1385, + "name": "current", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1378, + "src": "17498:7:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$64_memory_ptr", + "typeString": "struct AllowanceModule.Delegate memory" + } + }, + "id": 1386, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "delegate", + "nodeType": "MemberAccess", + "referencedDeclaration": 59, + "src": "17498:16:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "arguments": [ + { + "hexValue": "30", + "id": 1389, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "17526:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 1388, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "17518:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 1387, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "17518:7:0", + "typeDescriptions": {} + } + }, + "id": 1390, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "17518:10:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "src": "17498:30:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "&&", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "id": 1394, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 1392, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1362, + "src": "17532:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "id": 1393, + "name": "pageSize", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1345, + "src": "17536:8:0", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "src": "17532:12:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "17498:46:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 1416, + "nodeType": "WhileStatement", + "src": "17492:178:0" + }, + { + "expression": { + "id": 1423, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 1417, + "name": "next", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1351, + "src": "17679:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "expression": { + "id": 1420, + "name": "current", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1378, + "src": "17693:7:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$64_memory_ptr", + "typeString": "struct AllowanceModule.Delegate memory" + } + }, + "id": 1421, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "delegate", + "nodeType": "MemberAccess", + "referencedDeclaration": 59, + "src": "17693:16:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 1419, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "17686:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint48_$", + "typeString": "type(uint48)" + }, + "typeName": { + "id": 1418, + "name": "uint48", + "nodeType": "ElementaryTypeName", + "src": "17686:6:0", + "typeDescriptions": {} + } + }, + "id": 1422, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "17686:24:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "src": "17679:31:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "id": 1424, + "nodeType": "ExpressionStatement", + "src": "17679:31:0" + }, + { + "AST": { + "nodeType": "YulBlock", + "src": "17863:42:0", + "statements": [ + { + "expression": { + "arguments": [ + { + "name": "results", + "nodeType": "YulIdentifier", + "src": "17884:7:0" + }, + { + "name": "i", + "nodeType": "YulIdentifier", + "src": "17893:1:0" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "17877:6:0" + }, + "nodeType": "YulFunctionCall", + "src": "17877:18:0" + }, + "nodeType": "YulExpressionStatement", + "src": "17877:18:0" + } + ] + }, + "evmVersion": "istanbul", + "externalReferences": [ + { + "declaration": 1362, + "isOffset": false, + "isSlot": false, + "src": "17893:1:0", + "valueSize": 1 + }, + { + "declaration": 1349, + "isOffset": false, + "isSlot": false, + "src": "17884:7:0", + "valueSize": 1 + } + ], + "id": 1425, + "nodeType": "InlineAssembly", + "src": "17854:51:0" + } + ] + }, + "functionSelector": "eb37abe0", + "id": 1427, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getDelegates", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1346, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1341, + "mutability": "mutable", + "name": "safe", + "nodeType": "VariableDeclaration", + "scope": 1427, + "src": "17174:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1340, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "17174:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1343, + "mutability": "mutable", + "name": "start", + "nodeType": "VariableDeclaration", + "scope": 1427, + "src": "17188:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + }, + "typeName": { + "id": 1342, + "name": "uint48", + "nodeType": "ElementaryTypeName", + "src": "17188:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1345, + "mutability": "mutable", + "name": "pageSize", + "nodeType": "VariableDeclaration", + "scope": 1427, + "src": "17202:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "typeName": { + "id": 1344, + "name": "uint8", + "nodeType": "ElementaryTypeName", + "src": "17202:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "visibility": "internal" + } + ], + "src": "17173:44:0" + }, + "returnParameters": { + "id": 1352, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1349, + "mutability": "mutable", + "name": "results", + "nodeType": "VariableDeclaration", + "scope": 1427, + "src": "17239:24:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[]" + }, + "typeName": { + "baseType": { + "id": 1347, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "17239:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 1348, + "nodeType": "ArrayTypeName", + "src": "17239:9:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1351, + "mutability": "mutable", + "name": "next", + "nodeType": "VariableDeclaration", + "scope": 1427, + "src": "17265:11:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + }, + "typeName": { + "id": 1350, + "name": "uint48", + "nodeType": "ElementaryTypeName", + "src": "17265:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "visibility": "internal" + } + ], + "src": "17238:39:0" + }, + "scope": 1428, + "src": "17152:759:0", + "stateMutability": "view", + "virtual": false, + "visibility": "public" + } + ], + "scope": 1429, + "src": "648:17265:0" + } + ], + "src": "42:17871:0" + }, + "compiler": { + "name": "solc", + "version": "0.7.1+commit.f4a555be.Emscripten.clang" + }, + "networks": { + "4": { + "events": { + "0x2fd5b26f00131bd8ca0fc556207292b85a6bec241341df82724333227458e630": { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "safe", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "delegate", + "type": "address" + } + ], + "name": "AddDelegate", + "type": "event" + }, + "0xdccc2d936ded24d2153d2760581a7f0dcb23ec71190c9726b3584cdd700214d4": { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "safe", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "delegate", + "type": "address" + } + ], + "name": "RemoveDelegate", + "type": "event" + }, + "0xa11cca2c2027e28ab0046aab4d4040f59d8b06e819ccd974c1e53e86aa814c19": { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "safe", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "delegate", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint96", + "name": "value", + "type": "uint96" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "nonce", + "type": "uint16" + } + ], + "name": "ExecuteAllowanceTransfer", + "type": "event" + }, + "0x49caa04c5e1e168069c09df7f88c07ca87be980b0bf4570ab77fe9aae3ca7eba": { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "safe", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "delegate", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint96", + "name": "allowanceAmount", + "type": "uint96" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "resetTime", + "type": "uint16" + } + ], + "name": "SetAllowance", + "type": "event" + } + }, + "links": {}, + "address": "0x9e9Bf12b5a66c0f0A7435835e0365477E121B110", + "transactionHash": "0xc78f1aef6d837d7373fe352e70e3917f0798cee15a45dc8e74035263fd7988fb" + } + }, + "schemaVersion": "3.2.5", + "updatedAt": "2020-10-27T19:21:57.366Z", + "devdoc": { + "kind": "dev", + "methods": { + "addDelegate(address)": { + "details": "Allows to add a delegate.", + "params": { + "delegate": "Delegate that should be added." + } + }, + "deleteAllowance(address,address)": { + "details": "Allows to remove the allowance for a specific delegate and token. This will set all values except the `nonce` to 0.", + "params": { + "delegate": "Delegate whose allowance should be updated.", + "token": "Token contract address." + } + }, + "executeAllowanceTransfer(address,address,address,uint96,address,uint96,address,bytes)": { + "details": "Allows to use the allowance to perform a transfer.", + "params": { + "amount": "Amount that should be transferred.", + "delegate": "Delegate whose allowance should be updated.", + "payment": "Amount to should be paid for executing the transfer.", + "paymentToken": "Token that should be used to pay for the execution of the transfer.", + "safe": "The Safe whose funds should be used.", + "signature": "Signature generated by the delegate to authorize the transfer.", + "to": "Address that should receive the tokens.", + "token": "Token contract address." + } + }, + "generateTransferHash(address,address,address,uint96,address,uint96,uint16)": { + "details": "Generates the transfer hash that should be signed to authorize a transfer" + }, + "getChainId()": { + "details": "Returns the chain id used by this contract." + }, + "removeDelegate(address,bool)": { + "details": "Allows to remove a delegate.", + "params": { + "delegate": "Delegate that should be removed.", + "removeAllowances": "Indicator if allowances should also be removed. This should be set to `true` unless this causes an out of gas, in this case the allowances should be \"manually\" deleted via `deleteAllowance`." + } + }, + "resetAllowance(address,address)": { + "details": "Allows to reset the allowance for a specific delegate and token.", + "params": { + "delegate": "Delegate whose allowance should be updated.", + "token": "Token contract address." + } + }, + "setAllowance(address,address,uint96,uint16,uint32)": { + "details": "Allows to update the allowance for a specified token. This can only be done via a Safe transaction.", + "params": { + "allowanceAmount": "allowance in smallest token unit.", + "delegate": "Delegate whose allowance should be updated.", + "resetBaseMin": "Time based on which the reset time should be increased", + "resetTimeMin": "Time after which the allowance should reset", + "token": "Token contract address." + } + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + } +} diff --git a/src/logic/contracts/methodIds.ts b/src/logic/contracts/methodIds.ts index c91db228..36d72d08 100644 --- a/src/logic/contracts/methodIds.ts +++ b/src/logic/contracts/methodIds.ts @@ -1,78 +1,173 @@ +import { + DataDecoded, + SAFE_METHOD_ID_TO_NAME, + SAFE_METHODS_NAMES, + SPENDING_LIMIT_METHOD_ID_TO_NAME, + SPENDING_LIMIT_METHODS_NAMES, + TOKEN_TRANSFER_METHOD_ID_TO_NAME, + TOKEN_TRANSFER_METHODS_NAMES, +} from 'src/logic/safe/store/models/types/transactions.d' import { web3ReadOnly as web3 } from 'src/logic/wallets/getWeb3' -import { DataDecoded, METHOD_TO_ID } from 'src/routes/safe/store/models/types/transactions.d' +import { sameString } from 'src/utils/strings' + +type DecodeInfoProps = { + paramsHash: string + params: Record +} + +const decodeInfo = ({ paramsHash, params }: DecodeInfoProps): DataDecoded['parameters'] => { + const decodedParameters = web3.eth.abi.decodeParameters(Object.values(params), paramsHash) + + return Object.keys(params).map((name, index) => ({ + name, + type: params[name], + value: decodedParameters[index], + })) +} export const decodeParamsFromSafeMethod = (data: string): DataDecoded | null => { - const [methodId, params] = [data.slice(0, 10) as keyof typeof METHOD_TO_ID | string, data.slice(10)] + const [methodId, paramsHash] = [data.slice(0, 10), data.slice(10)] + const method = SAFE_METHODS_NAMES[methodId] - switch (methodId) { - // swapOwner - case '0xe318b52b': { - const decodedParameters = web3.eth.abi.decodeParameters(['uint', 'address', 'address'], params) as string[] - return { - method: METHOD_TO_ID[methodId], - parameters: [ - { name: 'oldOwner', type: 'address', value: decodedParameters[1] }, - { name: 'newOwner', type: 'address', value: decodedParameters[2] }, - ], + switch (method) { + case SAFE_METHODS_NAMES.SWAP_OWNER: { + const params = { + prevOwner: 'address', + oldOwner: 'address', + newOwner: 'address', } + + // we only need to return the addresses that has been swapped, no need for the `prevOwner` + const [, oldOwner, newOwner] = decodeInfo({ paramsHash, params }) + + return { method, parameters: [oldOwner, newOwner] } } - // addOwnerWithThreshold - case '0x0d582f13': { - const decodedParameters = web3.eth.abi.decodeParameters(['address', 'uint'], params) - return { - method: METHOD_TO_ID[methodId], - parameters: [ - { name: 'owner', type: 'address', value: decodedParameters[0] }, - { name: '_threshold', type: 'uint', value: decodedParameters[1] }, - ], + case SAFE_METHODS_NAMES.ADD_OWNER_WITH_THRESHOLD: { + const params = { + owner: 'address', + _threshold: 'uint', } + + const parameters = decodeInfo({ paramsHash, params }) + + return { method, parameters } } - // removeOwner - case '0xf8dc5dd9': { - const decodedParameters = web3.eth.abi.decodeParameters(['address', 'address', 'uint'], params) - return { - method: METHOD_TO_ID[methodId], - parameters: [ - { name: 'owner', type: 'address', value: decodedParameters[1] }, - { name: '_threshold', type: 'uint', value: decodedParameters[2] }, - ], + case SAFE_METHODS_NAMES.REMOVE_OWNER: { + const params = { + prevOwner: 'address', + owner: 'address', + _threshold: 'uint', } + + // we only need to return the removed owner and the new threshold, no need for the `prevOwner` + const [, oldOwner, threshold] = decodeInfo({ paramsHash, params }) + + return { method, parameters: [oldOwner, threshold] } } - // changeThreshold - case '0x694e80c3': { - const decodedParameters = web3.eth.abi.decodeParameters(['uint'], params) - return { - method: METHOD_TO_ID[methodId], - parameters: [ - { name: '_threshold', type: 'uint', value: decodedParameters[0] }, - ], + case SAFE_METHODS_NAMES.CHANGE_THRESHOLD: { + const params = { + _threshold: 'uint', } + + const parameters = decodeInfo({ paramsHash, params }) + + return { method, parameters } } - // enableModule - case '0x610b5925': { - const decodedParameters = web3.eth.abi.decodeParameters(['address'], params) - return { - method: METHOD_TO_ID[methodId], - parameters: [ - { name: 'module', type: 'address', value: decodedParameters[0] }, - ], + case SAFE_METHODS_NAMES.ENABLE_MODULE: { + const params = { + module: 'address', } + + const parameters = decodeInfo({ paramsHash, params }) + + return { method, parameters } } - // disableModule - case '0xe009cfde': { - const decodedParameters = web3.eth.abi.decodeParameters(['address', 'address'], params) - return { - method: METHOD_TO_ID[methodId], - parameters: [ - { name: 'prevModule', type: 'address', value: decodedParameters[0] }, - { name: 'module', type: 'address', value: decodedParameters[1] }, - ], + case SAFE_METHODS_NAMES.DISABLE_MODULE: { + const params = { + prevModule: 'address', + module: 'address', } + + const parameters = decodeInfo({ paramsHash, params }) + + return { method, parameters } + } + + default: + return null + } +} + +export const isSetAllowanceMethod = (data: string): boolean => { + const methodId = data.slice(0, 10) + return sameString(SPENDING_LIMIT_METHOD_ID_TO_NAME[methodId], SPENDING_LIMIT_METHODS_NAMES.SET_ALLOWANCE) +} + +export const isDeleteAllowanceMethod = (data: string): boolean => { + const methodId = data.slice(0, 10) + return sameString(SPENDING_LIMIT_METHOD_ID_TO_NAME[methodId], SPENDING_LIMIT_METHODS_NAMES.DELETE_ALLOWANCE) +} + +export const decodeParamsFromSpendingLimit = (data: string): DataDecoded | null => { + const [methodId, paramsHash] = [data.slice(0, 10), data.slice(10)] + const method = SPENDING_LIMIT_METHOD_ID_TO_NAME[methodId] + + switch (method) { + case SPENDING_LIMIT_METHODS_NAMES.ADD_DELEGATE: { + const params = { + delegate: 'address', + } + + const parameters = decodeInfo({ paramsHash, params }) + + return { method, parameters } + } + + case SPENDING_LIMIT_METHODS_NAMES.SET_ALLOWANCE: { + const params = { + delegate: 'address', + token: 'address', + allowanceAmount: 'uint96', + resetTimeMin: 'uint16', + resetBaseMin: 'uint32', + } + + const parameters = decodeInfo({ paramsHash, params }) + + return { method, parameters } + } + + case SPENDING_LIMIT_METHODS_NAMES.EXECUTE_ALLOWANCE_TRANSFER: { + const params = { + safe: 'address', + token: 'address', + to: 'address', + amount: 'uint96', + paymentToken: 'address', + payment: 'uint96', + delegate: 'address', + signature: 'bytes', + } + + const parameters = decodeInfo({ paramsHash, params }) + + return { method, parameters } + } + + case SPENDING_LIMIT_METHODS_NAMES.DELETE_ALLOWANCE: { + const params = { + delegate: 'address', + token: 'address', + } + + const parameters = decodeInfo({ paramsHash, params }) + + return { method, parameters } } default: @@ -81,57 +176,53 @@ export const decodeParamsFromSafeMethod = (data: string): DataDecoded | null => } const isSafeMethod = (methodId: string): boolean => { - return !!METHOD_TO_ID[methodId] + return !!SAFE_METHOD_ID_TO_NAME[methodId] } -export const decodeMethods = (data: string): DataDecoded | null => { - if(!data.length) { +const isSpendingLimitMethod = (methodId: string): boolean => { + return !!SPENDING_LIMIT_METHOD_ID_TO_NAME[methodId] +} + +export const decodeMethods = (data: string | null): DataDecoded | null => { + if (!data?.length) { return null } - const [methodId, params] = [data.slice(0, 10), data.slice(10)] + const [methodId, paramsHash] = [data.slice(0, 10), data.slice(10)] if (isSafeMethod(methodId)) { return decodeParamsFromSafeMethod(data) } - switch (methodId) { - // a9059cbb - transfer(address,uint256) - case '0xa9059cbb': { - const decodeParameters = web3.eth.abi.decodeParameters(['address', 'uint'], params) - return { - method: 'transfer', - parameters: [ - { name: 'to', type: '', value: decodeParameters[0] }, - { name: 'value', type: '', value: decodeParameters[1] }, - ], + if (isSpendingLimitMethod(methodId)) { + return decodeParamsFromSpendingLimit(data) + } + + const method = TOKEN_TRANSFER_METHOD_ID_TO_NAME[methodId] + + switch (method) { + case TOKEN_TRANSFER_METHODS_NAMES.TRANSFER: { + const params = { + to: 'address', + value: 'uint', } + + const parameters = decodeInfo({ paramsHash, params }) + + return { method, parameters } } - // 23b872dd - transferFrom(address,address,uint256) - case '0x23b872dd': { - const decodeParameters = web3.eth.abi.decodeParameters(['address', 'address', 'uint'], params) - return { - method: 'transferFrom', - parameters: [ - { name: 'from', type: '', value: decodeParameters[0] }, - { name: 'to', type: '', value: decodeParameters[1] }, - { name: 'value', type: '', value: decodeParameters[2] }, - ], + case TOKEN_TRANSFER_METHODS_NAMES.TRANSFER_FROM: + case TOKEN_TRANSFER_METHODS_NAMES.SAFE_TRANSFER_FROM: { + const params = { + from: 'address', + to: 'address', + value: 'uint', } - } - // 42842e0e - safeTransferFrom(address,address,uint256) - case '0x42842e0e': { - const decodedParameters = web3.eth.abi.decodeParameters(['address', 'address', 'uint'], params) - return { - method: 'safeTransferFrom', - parameters: [ - { name: 'from', type: '', value: decodedParameters[0] }, - { name: 'to', type: '', value: decodedParameters[1] }, - { name: 'value', type: '', value: decodedParameters[2] }, - ], - } + const parameters = decodeInfo({ paramsHash, params }) + + return { method, parameters } } default: diff --git a/src/logic/contracts/safeContracts.ts b/src/logic/contracts/safeContracts.ts index cc85b846..f392a17a 100644 --- a/src/logic/contracts/safeContracts.ts +++ b/src/logic/contracts/safeContracts.ts @@ -12,6 +12,9 @@ import { calculateGasOf, calculateGasPrice } from 'src/logic/wallets/ethTransact import { getWeb3, getNetworkIdFrom } from 'src/logic/wallets/getWeb3' import { GnosisSafe } from 'src/types/contracts/GnosisSafe.d' import { GnosisSafeProxyFactory } from 'src/types/contracts/GnosisSafeProxyFactory.d' +import { SPENDING_LIMIT_MODULE_ADDRESS } from 'src/utils/constants' + +import SpendingLimitModule from './artifacts/AllowanceModule.json' export const SENTINEL_ADDRESS = '0x0000000000000000000000000000000000000001' export const MULTI_SEND_ADDRESS = '0x8d29be29923b68abfdd21e541b9374737b49cdad' @@ -51,8 +54,13 @@ const createProxyFactoryContract = (web3: Web3, networkId: ETHEREUM_NETWORK): Gn return new web3.eth.Contract(ProxyFactorySol.abi as AbiItem[], contractAddress) as unknown as GnosisSafeProxyFactory } -export const getGnosisSafeContract = memoize(createGnosisSafeContract) +const createSpendingLimitContract = () => { + const web3 = getWeb3() + return new web3.eth.Contract(SpendingLimitModule.abi as AbiItem[], SPENDING_LIMIT_MODULE_ADDRESS) +} +export const getGnosisSafeContract = memoize(createGnosisSafeContract) +export const getSpendingLimitContract = memoize(createSpendingLimitContract) const getCreateProxyFactoryContract = memoize(createProxyFactoryContract) const instantiateMasterCopies = async () => { diff --git a/src/logic/notifications/notificationBuilder.tsx b/src/logic/notifications/notificationBuilder.tsx index fd815385..912bbabd 100644 --- a/src/logic/notifications/notificationBuilder.tsx +++ b/src/logic/notifications/notificationBuilder.tsx @@ -99,6 +99,28 @@ const settingsChangeTxNotificationsQueue = { afterExecutionError: NOTIFICATIONS.SETTINGS_CHANGE_FAILED_MSG, } +const newSpendingLimitTxNotificationsQueue = { + beforeExecution: NOTIFICATIONS.SIGN_NEW_SPENDING_LIMIT_MSG, + pendingExecution: NOTIFICATIONS.NEW_SPENDING_LIMIT_PENDING_MSG, + afterRejection: NOTIFICATIONS.NEW_SPENDING_LIMIT_REJECTED_MSG, + afterExecution: { + noMoreConfirmationsNeeded: NOTIFICATIONS.NEW_SPENDING_LIMIT_EXECUTED_MSG, + moreConfirmationsNeeded: NOTIFICATIONS.NEW_SPENDING_LIMIT_EXECUTED_MORE_CONFIRMATIONS_MSG, + }, + afterExecutionError: NOTIFICATIONS.NEW_SPENDING_LIMIT_FAILED_MSG, +} + +const removeSpendingLimitTxNotificationsQueue = { + beforeExecution: NOTIFICATIONS.SIGN_REMOVE_SPENDING_LIMIT_MSG, + pendingExecution: NOTIFICATIONS.REMOVE_SPENDING_LIMIT_PENDING_MSG, + afterRejection: NOTIFICATIONS.REMOVE_SPENDING_LIMIT_REJECTED_MSG, + afterExecution: { + noMoreConfirmationsNeeded: NOTIFICATIONS.REMOVE_SPENDING_LIMIT_EXECUTED_MSG, + moreConfirmationsNeeded: NOTIFICATIONS.REMOVE_SPENDING_LIMIT_EXECUTED_MORE_CONFIRMATIONS_MSG, + }, + afterExecutionError: NOTIFICATIONS.REMOVE_SPENDING_LIMIT_FAILED_MSG, +} + const defaultNotificationsQueue = { beforeExecution: NOTIFICATIONS.SIGN_TX_MSG, pendingExecution: NOTIFICATIONS.TX_PENDING_MSG, @@ -166,6 +188,14 @@ export const getNotificationsFromTxType: any = (txType, origin) => { notificationsQueue = settingsChangeTxNotificationsQueue break } + case TX_NOTIFICATION_TYPES.NEW_SPENDING_LIMIT_TX: { + notificationsQueue = newSpendingLimitTxNotificationsQueue + break + } + case TX_NOTIFICATION_TYPES.REMOVE_SPENDING_LIMIT_TX: { + notificationsQueue = removeSpendingLimitTxNotificationsQueue + break + } case TX_NOTIFICATION_TYPES.SAFE_NAME_CHANGE_TX: { notificationsQueue = safeNameChangeNotificationsQueue break diff --git a/src/logic/notifications/notificationTypes.ts b/src/logic/notifications/notificationTypes.ts index 97650456..e70636b7 100644 --- a/src/logic/notifications/notificationTypes.ts +++ b/src/logic/notifications/notificationTypes.ts @@ -46,6 +46,18 @@ const NOTIFICATION_IDS = { SETTINGS_CHANGE_EXECUTED_MORE_CONFIRMATIONS_MSG: 'SETTINGS_CHANGE_EXECUTED_MORE_CONFIRMATIONS_MSG', SETTINGS_CHANGE_FAILED_MSG: 'SETTINGS_CHANGE_FAILED_MSG', TESTNET_VERSION_MSG: 'TESTNET_VERSION_MSG', + SIGN_NEW_SPENDING_LIMIT_MSG: 'SIGN_NEW_SPENDING_LIMIT_MSG', + NEW_SPENDING_LIMIT_PENDING_MSG: 'NEW_SPENDING_LIMIT_PENDING_MSG', + NEW_SPENDING_LIMIT_REJECTED_MSG: 'NEW_SPENDING_LIMIT_REJECTED_MSG', + NEW_SPENDING_LIMIT_EXECUTED_MSG: 'NEW_SPENDING_LIMIT_EXECUTED_MSG', + NEW_SPENDING_LIMIT_EXECUTED_MORE_CONFIRMATIONS_MSG: 'NEW_SPENDING_LIMIT_EXECUTED_MORE_CONFIRMATIONS_MSG', + NEW_SPENDING_LIMIT_FAILED_MSG: 'NEW_SPENDING_LIMIT_FAILED_MSG', + SIGN_REMOVE_SPENDING_LIMIT_MSG: 'SIGN_REMOVE_SPENDING_LIMIT_MSG', + REMOVE_SPENDING_LIMIT_PENDING_MSG: 'REMOVE_SPENDING_LIMIT_PENDING_MSG', + REMOVE_SPENDING_LIMIT_REJECTED_MSG: 'REMOVE_SPENDING_LIMIT_REJECTED_MSG', + REMOVE_SPENDING_LIMIT_EXECUTED_MSG: 'REMOVE_SPENDING_LIMIT_EXECUTED_MSG', + REMOVE_SPENDING_LIMIT_EXECUTED_MORE_CONFIRMATIONS_MSG: 'REMOVE_SPENDING_LIMIT_EXECUTED_MORE_CONFIRMATIONS_MSG', + REMOVE_SPENDING_LIMIT_FAILED_MSG: 'REMOVE_SPENDING_LIMIT_FAILED_MSG', WRONG_NETWORK_MSG: 'WRONG_NETWORK_MSG', ADDRESS_BOOK_NEW_ENTRY_SUCCESS: 'ADDRESS_BOOK_NEW_ENTRY_SUCCESS', ADDRESS_BOOK_EDIT_ENTRY_SUCCESS: 'ADDRESS_BOOK_EDIT_ENTRY_SUCCESS', @@ -191,6 +203,56 @@ export const NOTIFICATIONS: Record = { options: { variant: ERROR, persist: false, autoHideDuration: longDuration }, }, + // Spending Limit + SIGN_NEW_SPENDING_LIMIT_MSG: { + message: 'Please sign the new Spending Limit', + options: { variant: INFO, persist: true }, + }, + NEW_SPENDING_LIMIT_PENDING_MSG: { + message: 'New Spending Limit pending', + options: { variant: INFO, persist: true }, + }, + NEW_SPENDING_LIMIT_REJECTED_MSG: { + message: 'New Spending Limit rejected', + options: { variant: ERROR, persist: false, autoHideDuration: longDuration }, + }, + NEW_SPENDING_LIMIT_EXECUTED_MSG: { + message: 'New Spending Limit successfully executed', + options: { variant: SUCCESS, persist: false, autoHideDuration: longDuration }, + }, + NEW_SPENDING_LIMIT_EXECUTED_MORE_CONFIRMATIONS_MSG: { + message: 'New Spending Limit successfully created. More confirmations needed to execute', + options: { variant: SUCCESS, persist: false, autoHideDuration: longDuration }, + }, + NEW_SPENDING_LIMIT_FAILED_MSG: { + message: 'New Spending Limit failed', + options: { variant: ERROR, persist: false, autoHideDuration: longDuration }, + }, + SIGN_REMOVE_SPENDING_LIMIT_MSG: { + message: 'Please sign the remove Spending Limit', + options: { variant: INFO, persist: true }, + }, + REMOVE_SPENDING_LIMIT_PENDING_MSG: { + message: 'Remove Spending Limit pending', + options: { variant: INFO, persist: true }, + }, + REMOVE_SPENDING_LIMIT_REJECTED_MSG: { + message: 'Remove Spending Limit rejected', + options: { variant: ERROR, persist: false, autoHideDuration: longDuration }, + }, + REMOVE_SPENDING_LIMIT_EXECUTED_MSG: { + message: 'Remove Spending Limit successfully executed', + options: { variant: SUCCESS, persist: false, autoHideDuration: longDuration }, + }, + REMOVE_SPENDING_LIMIT_EXECUTED_MORE_CONFIRMATIONS_MSG: { + message: 'Remove Spending Limit successfully created. More confirmations needed to execute', + options: { variant: SUCCESS, persist: false, autoHideDuration: longDuration }, + }, + REMOVE_SPENDING_LIMIT_FAILED_MSG: { + message: 'Remove Spending Limit failed', + options: { variant: ERROR, persist: false, autoHideDuration: longDuration }, + }, + // Network TESTNET_VERSION_MSG: { message: "Testnet Version: Don't send production assets to this Safe", diff --git a/src/logic/safe/hooks/useTokenInfo.tsx b/src/logic/safe/hooks/useTokenInfo.tsx new file mode 100644 index 00000000..c05f161c --- /dev/null +++ b/src/logic/safe/hooks/useTokenInfo.tsx @@ -0,0 +1,19 @@ +import { useSelector } from 'react-redux' + +import { getNetworkInfo } from 'src/config' +import { Token } from 'src/logic/tokens/store/model/token' +import { sameAddress, ZERO_ADDRESS } from 'src/logic/wallets/ethAddresses' +import { safeKnownCoins } from 'src/routes/safe/container/selector' + +const { nativeCoin } = getNetworkInfo() + +const useTokenInfo = (address: string): Token | undefined => { + const tokens = useSelector(safeKnownCoins) + + if (tokens) { + const tokenAddress = sameAddress(address, ZERO_ADDRESS) ? nativeCoin.address : address + return tokens.find((token) => sameAddress(token.address, tokenAddress)) ?? undefined + } +} + +export default useTokenInfo diff --git a/src/logic/safe/store/actions/addModuleTransactions.ts b/src/logic/safe/store/actions/addModuleTransactions.ts new file mode 100644 index 00000000..6c26cb59 --- /dev/null +++ b/src/logic/safe/store/actions/addModuleTransactions.ts @@ -0,0 +1,13 @@ +import { createAction } from 'redux-actions' +import { ModuleTxServiceModel } from 'src/logic/safe/store/actions/transactions/fetchTransactions/loadModuleTransactions' + +export const ADD_MODULE_TRANSACTIONS = 'ADD_MODULE_TRANSACTIONS' + +export type AddModuleTransactionsAction = { + payload: { + safeAddress: string + modules: ModuleTxServiceModel[] + } +} + +export const addModuleTransactions = createAction(ADD_MODULE_TRANSACTIONS) diff --git a/src/logic/safe/store/actions/createTransaction.ts b/src/logic/safe/store/actions/createTransaction.ts index 6922c0f7..23570126 100644 --- a/src/logic/safe/store/actions/createTransaction.ts +++ b/src/logic/safe/store/actions/createTransaction.ts @@ -41,7 +41,7 @@ import { PayableTx } from 'src/types/contracts/types.d' import { AppReduxState } from 'src/store' import { Dispatch, DispatchReturn } from './types' -interface CreateTransactionArgs { +export interface CreateTransactionArgs { navigateToTransactionsTab?: boolean notifiedTransaction: string operation?: number diff --git a/src/logic/safe/store/actions/fetchSafe.ts b/src/logic/safe/store/actions/fetchSafe.ts index 201e75d3..71e2218f 100644 --- a/src/logic/safe/store/actions/fetchSafe.ts +++ b/src/logic/safe/store/actions/fetchSafe.ts @@ -18,6 +18,7 @@ import { AppReduxState } from 'src/store' import { latestMasterContractVersionSelector } from 'src/logic/safe/store/selectors' import { getSafeInfo } from 'src/logic/safe/utils/safeInformation' import { getModules } from 'src/logic/safe/utils/modules' +import { getSpendingLimits } from 'src/logic/safe/utils/spendingLimits' const buildOwnersFrom = (safeOwners: string[], localSafe?: SafeRecordProps): List => { const ownersList = safeOwners.map((ownerAddress) => { @@ -71,6 +72,7 @@ export const buildSafe = async ( const needsUpdate = safeNeedsUpdate(currentVersion, latestMasterContractVersion) const featuresEnabled = enabledFeatures(currentVersion) const modules = await getModules(safeInfo) + const spendingLimits = safeInfo ? await getSpendingLimits(safeInfo.modules, safeAddress) : null return { address: safeAddress, @@ -89,6 +91,7 @@ export const buildSafe = async ( blacklistedAssets: Set(), blacklistedTokens: Set(), modules, + spendingLimits, } } @@ -106,6 +109,9 @@ export const checkAndUpdateSafe = (safeAdd: string) => async (dispatch: Dispatch getLocalSafe(safeAddress), ]) + // request SpendingLimit info + const spendingLimits = safeInfo ? await getSpendingLimits(safeInfo.modules, safeAddress) : null + // Converts from [ { address, ownerName} ] to address array const localOwners = localSafe ? localSafe.owners.map((localOwner) => localOwner.address) : [] @@ -116,6 +122,7 @@ export const checkAndUpdateSafe = (safeAdd: string) => async (dispatch: Dispatch address: safeAddress, name: localSafe?.name, modules, + spendingLimits, nonce: Number(remoteNonce), threshold: Number(remoteThreshold), featuresEnabled: localSafe?.currentVersion diff --git a/src/logic/safe/store/actions/transactions/fetchTransactions/fetchTransactions.ts b/src/logic/safe/store/actions/transactions/fetchTransactions/fetchTransactions.ts index e97a6883..a1cf32df 100644 --- a/src/logic/safe/store/actions/transactions/fetchTransactions/fetchTransactions.ts +++ b/src/logic/safe/store/actions/transactions/fetchTransactions/fetchTransactions.ts @@ -2,19 +2,27 @@ import axios from 'axios' import { buildTxServiceUrl } from 'src/logic/safe/transactions' import { buildIncomingTxServiceUrl } from 'src/logic/safe/transactions/incomingTxHistory' +import { buildModuleTxServiceUrl } from 'src/logic/safe/transactions/moduleTxHistory' import { TxServiceModel } from 'src/logic/safe/store/actions/transactions/fetchTransactions/loadOutgoingTransactions' import { IncomingTxServiceModel } from 'src/logic/safe/store/actions/transactions/fetchTransactions/loadIncomingTransactions' import { TransactionTypes } from 'src/logic/safe/store/models/types/transaction' +import { ModuleTxServiceModel } from './loadModuleTransactions' const getServiceUrl = (txType: string, safeAddress: string): string => { return { [TransactionTypes.INCOMING]: buildIncomingTxServiceUrl, [TransactionTypes.OUTGOING]: buildTxServiceUrl, + [TransactionTypes.MODULE]: buildModuleTxServiceUrl, }[txType](safeAddress) } // TODO: Remove this magic /* eslint-disable */ +async function fetchTransactions( + txType: TransactionTypes.MODULE, + safeAddress: string, + eTag: string | null, +): Promise<{ eTag: string | null; results: ModuleTxServiceModel[] }> async function fetchTransactions( txType: TransactionTypes.INCOMING, safeAddress: string, @@ -26,10 +34,10 @@ async function fetchTransactions( eTag: string | null, ): Promise<{ eTag: string | null; results: TxServiceModel[] }> async function fetchTransactions( - txType: TransactionTypes.INCOMING | TransactionTypes.OUTGOING, + txType: TransactionTypes.MODULE | TransactionTypes.INCOMING | TransactionTypes.OUTGOING, safeAddress: string, eTag: string | null, -): Promise<{ eTag: string | null; results: TxServiceModel[] | IncomingTxServiceModel[] }> { +): Promise<{ eTag: string | null; results: ModuleTxServiceModel[] | TxServiceModel[] | IncomingTxServiceModel[] }> { /* eslint-enable */ try { const url = getServiceUrl(txType, safeAddress) diff --git a/src/logic/safe/store/actions/transactions/fetchTransactions/index.ts b/src/logic/safe/store/actions/transactions/fetchTransactions/index.ts index 09d00a05..271ee746 100644 --- a/src/logic/safe/store/actions/transactions/fetchTransactions/index.ts +++ b/src/logic/safe/store/actions/transactions/fetchTransactions/index.ts @@ -3,9 +3,11 @@ import { ThunkAction, ThunkDispatch } from 'redux-thunk' import { AnyAction } from 'redux' import { backOff } from 'exponential-backoff' -import { addIncomingTransactions } from '../../addIncomingTransactions' +import { addIncomingTransactions } from 'src/logic/safe/store/actions/addIncomingTransactions' +import { addModuleTransactions } from 'src/logic/safe/store/actions/addModuleTransactions' import { loadIncomingTransactions } from './loadIncomingTransactions' +import { loadModuleTransactions } from './loadModuleTransactions' import { loadOutgoingTransactions } from './loadOutgoingTransactions' import { addOrUpdateCancellationTransactions } from 'src/logic/safe/store/actions/transactions/addOrUpdateCancellationTransactions' @@ -44,6 +46,12 @@ export default (safeAddress: string): ThunkAction, AppReduxState, if (safeIncomingTxs?.size) { dispatch(addIncomingTransactions(incomingTransactions)) } + + const moduleTransactions = await loadModuleTransactions(safeAddress) + + if (moduleTransactions.length) { + dispatch(addModuleTransactions({ modules: moduleTransactions, safeAddress })) + } } catch (error) { console.log('Error fetching transactions:', error) } diff --git a/src/logic/safe/store/actions/transactions/fetchTransactions/loadModuleTransactions.ts b/src/logic/safe/store/actions/transactions/fetchTransactions/loadModuleTransactions.ts new file mode 100644 index 00000000..7dd1b7b7 --- /dev/null +++ b/src/logic/safe/store/actions/transactions/fetchTransactions/loadModuleTransactions.ts @@ -0,0 +1,35 @@ +import fetchTransactions from 'src/logic/safe/store/actions/transactions/fetchTransactions/fetchTransactions' +import { TransactionTypes } from 'src/logic/safe/store/models/types/transaction' +import { DataDecoded, Operation } from 'src/logic/safe/store/models/types/transactions.d' + +export type ModuleTxServiceModel = { + created: string + executionDate: string + blockNumber: number + transactionHash: string + safe: string + module: string + to: string + value: string + data: string + operation: Operation + dataDecoded: DataDecoded +} + +type ETag = string | null + +let previousETag: ETag = null +export const loadModuleTransactions = async (safeAddress: string): Promise => { + if (!safeAddress) { + return [] + } + + const { eTag, results }: { eTag: ETag; results: ModuleTxServiceModel[] } = await fetchTransactions( + TransactionTypes.MODULE, + safeAddress, + previousETag, + ) + previousETag = eTag + + return results +} diff --git a/src/logic/safe/store/models/safe.ts b/src/logic/safe/store/models/safe.ts index 89515c76..7d0547e0 100644 --- a/src/logic/safe/store/models/safe.ts +++ b/src/logic/safe/store/models/safe.ts @@ -13,6 +13,16 @@ export type ModulePair = [ string, ] +export type SpendingLimit = { + delegate: string + token: string + amount: string + spent: string + resetTimeMin: string + lastResetMin: string + nonce: string +} + export type SafeRecordProps = { name: string address: string @@ -20,6 +30,7 @@ export type SafeRecordProps = { ethBalance: string owners: List modules?: ModulePair[] | null + spendingLimits?: SpendingLimit[] | null activeTokens: Set activeAssets: Set blacklistedTokens: Set @@ -40,6 +51,7 @@ const makeSafe = Record({ ethBalance: '0', owners: List([]), modules: [], + spendingLimits: [], activeTokens: Set(), activeAssets: Set(), blacklistedTokens: Set(), diff --git a/src/logic/safe/store/models/types/transaction.ts b/src/logic/safe/store/models/types/transaction.ts index a44bcc47..d190a1e0 100644 --- a/src/logic/safe/store/models/types/transaction.ts +++ b/src/logic/safe/store/models/types/transaction.ts @@ -1,4 +1,7 @@ import { List, Map, RecordOf } from 'immutable' + +import { ModuleTxServiceModel } from 'src/logic/safe/store/actions/transactions/fetchTransactions/loadModuleTransactions' +import { Token } from 'src/logic/tokens/store/model/token' import { Confirmation } from './confirmation' import { GnosisSafe } from 'src/types/contracts/GnosisSafe.d' import { DataDecoded, Transfer } from './transactions' @@ -14,6 +17,8 @@ export enum TransactionTypes { UPGRADE = 'upgrade', TOKEN = 'token', COLLECTIBLE = 'collectible', + MODULE = 'module', + SPENDING_LIMIT = 'spendingLimit', } export type TransactionTypeValues = typeof TransactionTypes[keyof typeof TransactionTypes] @@ -47,7 +52,7 @@ export type TransactionProps = { data: string | null dataDecoded: DataDecoded | null decimals?: (number | string) | null - decodedParams: DecodedParams | null + decodedParams: DecodedParams executionDate?: string | null executionTxHash?: string | null executor: string @@ -101,3 +106,17 @@ export type TxArgs = { to: string valueInWei: string } + +type SafeModuleCompatibilityTypes = { + nonce?: string // not required for this tx: added for compatibility + fee?: number // not required for this tx: added for compatibility + executionTxHash?: string // not required for this tx: added for compatibility + safeTxHash: string // table uses this key as a unique row identifier, added for compatibility +} + +export type SafeModuleTransaction = ModuleTxServiceModel & + SafeModuleCompatibilityTypes & { + status: TransactionStatus + type: TransactionTypes + tokenInfo?: Token + } diff --git a/src/logic/safe/store/models/types/transactions.d.ts b/src/logic/safe/store/models/types/transactions.d.ts index b606d49b..4d753d61 100644 --- a/src/logic/safe/store/models/types/transactions.d.ts +++ b/src/logic/safe/store/models/types/transactions.d.ts @@ -228,16 +228,30 @@ export const SAFE_METHODS_NAMES = { SWAP_OWNER: 'swapOwner', ENABLE_MODULE: 'enableModule', DISABLE_MODULE: 'disableModule', -} +} as const -export const METHOD_TO_ID = { +export const SAFE_METHOD_ID_TO_NAME = { '0xe318b52b': SAFE_METHODS_NAMES.SWAP_OWNER, '0x0d582f13': SAFE_METHODS_NAMES.ADD_OWNER_WITH_THRESHOLD, '0xf8dc5dd9': SAFE_METHODS_NAMES.REMOVE_OWNER, '0x694e80c3': SAFE_METHODS_NAMES.CHANGE_THRESHOLD, '0x610b5925': SAFE_METHODS_NAMES.ENABLE_MODULE, '0xe009cfde': SAFE_METHODS_NAMES.DISABLE_MODULE, -} +} as const + +export const SPENDING_LIMIT_METHODS_NAMES = { + ADD_DELEGATE: 'addDelegate', + SET_ALLOWANCE: 'setAllowance', + EXECUTE_ALLOWANCE_TRANSFER: 'executeAllowanceTransfer', + DELETE_ALLOWANCE: 'deleteAllowance', +} as const + +export const SPENDING_LIMIT_METHOD_ID_TO_NAME = { + '0xe71bdf41': SPENDING_LIMIT_METHODS_NAMES.ADD_DELEGATE, + '0xbeaeb388': SPENDING_LIMIT_METHODS_NAMES.SET_ALLOWANCE, + '0x4515641a': SPENDING_LIMIT_METHODS_NAMES.EXECUTE_ALLOWANCE_TRANSFER, + '0x885133e3': SPENDING_LIMIT_METHODS_NAMES.DELETE_ALLOWANCE, +} as const export type SafeMethods = typeof SAFE_METHODS_NAMES[keyof typeof SAFE_METHODS_NAMES] @@ -247,13 +261,19 @@ export const TOKEN_TRANSFER_METHODS_NAMES = { SAFE_TRANSFER_FROM: 'safeTransferFrom', } as const +export const TOKEN_TRANSFER_METHOD_ID_TO_NAME = { + '0xa9059cbb': TOKEN_TRANSFER_METHODS_NAMES.TRANSFER, + '0x23b872dd': TOKEN_TRANSFER_METHODS_NAMES.TRANSFER_FROM, + '0x42842e0e': TOKEN_TRANSFER_METHODS_NAMES.SAFE_TRANSFER_FROM, +} as const + type TokenMethods = typeof TOKEN_TRANSFER_METHODS_NAMES[keyof typeof TOKEN_TRANSFER_METHODS_NAMES] -type SafeDecodedParams = { +export type SafeDecodedParams = { [key in SafeMethods]?: Record } -type TokenDecodedParams = { +export type TokenDecodedParams = { [key in TokenMethods]?: Record } diff --git a/src/logic/safe/store/reducer/moduleTransactions.ts b/src/logic/safe/store/reducer/moduleTransactions.ts new file mode 100644 index 00000000..27b310b2 --- /dev/null +++ b/src/logic/safe/store/reducer/moduleTransactions.ts @@ -0,0 +1,32 @@ +import { handleActions } from 'redux-actions' + +import { + ADD_MODULE_TRANSACTIONS, + AddModuleTransactionsAction, +} from 'src/logic/safe/store/actions/addModuleTransactions' +import { ModuleTxServiceModel } from 'src/logic/safe/store/actions/transactions/fetchTransactions/loadModuleTransactions' + +export const MODULE_TRANSACTIONS_REDUCER_ID = 'moduleTransactions' + +export interface ModuleTransactionsState { + [safeAddress: string]: ModuleTxServiceModel[] +} + +export default handleActions( + { + [ADD_MODULE_TRANSACTIONS]: (state: ModuleTransactionsState, action: AddModuleTransactionsAction) => { + const { modules, safeAddress } = action.payload + const oldModuleTxs = state[safeAddress] ?? [] + const oldModuleTxsHashes = oldModuleTxs.map(({ transactionHash }) => transactionHash) + // As backend is returning the whole list of txs on every request, + // to avoid duplicates, filtering happens in this level. + const newModuleTxs = modules.filter((moduleTx) => !oldModuleTxsHashes.includes(moduleTx.transactionHash)) + + return { + ...state, + [safeAddress]: [...oldModuleTxs, ...newModuleTxs], + } + }, + }, + {}, +) diff --git a/src/logic/safe/store/selectors/index.ts b/src/logic/safe/store/selectors/index.ts index 63449c96..23959e6f 100644 --- a/src/logic/safe/store/selectors/index.ts +++ b/src/logic/safe/store/selectors/index.ts @@ -208,6 +208,8 @@ export const safeModulesSelector = createSelector(safeSelector, safeFieldSelecto export const safeFeaturesEnabledSelector = createSelector(safeSelector, safeFieldSelector('featuresEnabled')) +export const safeSpendingLimitsSelector = createSelector(safeSelector, safeFieldSelector('spendingLimits')) + export const safeOwnersAddressesListSelector = createSelector( safeOwnersSelector, (owners): List => { diff --git a/src/logic/safe/store/selectors/transactions.ts b/src/logic/safe/store/selectors/transactions.ts index 123f360e..323d7be8 100644 --- a/src/logic/safe/store/selectors/transactions.ts +++ b/src/logic/safe/store/selectors/transactions.ts @@ -2,10 +2,13 @@ import { List } from 'immutable' import { createSelector } from 'reselect' import { safeIncomingTransactionsSelector, safeTransactionsSelector } from 'src/logic/safe/store/selectors' -import { Transaction } from 'src/logic/safe/store/models/types/transaction' +import { Transaction, SafeModuleTransaction } from 'src/logic/safe/store/models/types/transaction' +import { safeModuleTransactionsSelector } from 'src/routes/safe/container/selector' export const extendedTransactionsSelector = createSelector( safeTransactionsSelector, safeIncomingTransactionsSelector, - (transactions, incomingTransactions): List => List([...transactions, ...incomingTransactions]), + safeModuleTransactionsSelector, + (transactions, incomingTransactions, moduleTransactions): List => + List([...transactions, ...incomingTransactions, ...moduleTransactions]), ) diff --git a/src/logic/safe/transactions/moduleTxHistory.ts b/src/logic/safe/transactions/moduleTxHistory.ts new file mode 100644 index 00000000..656b4381 --- /dev/null +++ b/src/logic/safe/transactions/moduleTxHistory.ts @@ -0,0 +1,9 @@ +import { getSafeServiceBaseUrl } from 'src/config' +import { checksumAddress } from 'src/utils/checksumAddress' + +export const buildModuleTxServiceUrl = (safeAddress: string): string => { + const address = checksumAddress(safeAddress) + const url = getSafeServiceBaseUrl(address) + + return `${url}/module-transactions/` +} diff --git a/src/logic/safe/transactions/notifiedTransactions.ts b/src/logic/safe/transactions/notifiedTransactions.ts index 83700fd9..f166bbab 100644 --- a/src/logic/safe/transactions/notifiedTransactions.ts +++ b/src/logic/safe/transactions/notifiedTransactions.ts @@ -1,11 +1,14 @@ -export const TX_NOTIFICATION_TYPES: any = { +export const TX_NOTIFICATION_TYPES = { STANDARD_TX: 'STANDARD_TX', CONFIRMATION_TX: 'CONFIRMATION_TX', CANCELLATION_TX: 'CANCELLATION_TX', WAITING_TX: 'WAITING_TX', SETTINGS_CHANGE_TX: 'SETTINGS_CHANGE_TX', + NEW_SPENDING_LIMIT_TX: 'NEW_SPENDING_LIMIT_TX', + REMOVE_SPENDING_LIMIT_TX: 'REMOVE_SPENDING_LIMIT_TX', SAFE_NAME_CHANGE_TX: 'SAFE_NAME_CHANGE_TX', OWNER_NAME_CHANGE_TX: 'OWNER_NAME_CHANGE_TX', ADDRESSBOOK_NEW_ENTRY: 'ADDRESSBOOK_NEW_ENTRY', + ADDRESSBOOK_EDIT_ENTRY: 'ADDRESSBOOK_EDIT_ENTRY', ADDRESSBOOK_DELETE_ENTRY: 'ADDRESSBOOK_DELETE_ENTRY', } diff --git a/src/logic/safe/utils/modules.ts b/src/logic/safe/utils/modules.ts index 7b934609..c863fbe5 100644 --- a/src/logic/safe/utils/modules.ts +++ b/src/logic/safe/utils/modules.ts @@ -1,7 +1,9 @@ import semverLessThan from 'semver/functions/lt' import { getGnosisSafeInstanceAt, SENTINEL_ADDRESS } from 'src/logic/contracts/safeContracts' +import { CreateTransactionArgs } from 'src/logic/safe/store/actions/createTransaction' import { ModulePair } from 'src/logic/safe/store/models/safe' +import { CALL, TX_NOTIFICATION_TYPES } from 'src/logic/safe/transactions' import { SafeInfo } from 'src/logic/safe/utils/safeInformation' type ModulesPaginated = { @@ -97,3 +99,20 @@ export const getDisableModuleTxData = (modulePair: ModulePair, safeAddress: stri return safeInstance.methods.disableModule(previousModule, module).encodeABI() } + +type EnableModuleParams = { + moduleAddress: string + safeAddress: string +} +export const enableModuleTx = ({ moduleAddress, safeAddress }: EnableModuleParams): CreateTransactionArgs => { + const safeInstance = getGnosisSafeInstanceAt(safeAddress) + + return { + safeAddress, + to: safeAddress, + operation: CALL, + valueInWei: '0', + txData: safeInstance.methods.enableModule(moduleAddress).encodeABI(), + notifiedTransaction: TX_NOTIFICATION_TYPES.SETTINGS_CHANGE_TX, + } +} diff --git a/src/logic/safe/utils/spendingLimits.ts b/src/logic/safe/utils/spendingLimits.ts new file mode 100644 index 00000000..c23d639e --- /dev/null +++ b/src/logic/safe/utils/spendingLimits.ts @@ -0,0 +1,294 @@ +import { BigNumber } from 'bignumber.js' +import { getNetworkInfo } from 'src/config' +import { AbiItem } from 'web3-utils' + +import { CreateTransactionArgs } from 'src/logic/safe/store/actions/createTransaction' +import { CALL, DELEGATE_CALL, TX_NOTIFICATION_TYPES } from 'src/logic/safe/transactions' +import { enableModuleTx } from 'src/logic/safe/utils/modules' +import SpendingLimitModule from 'src/logic/contracts/artifacts/AllowanceModule.json' +import generateBatchRequests from 'src/logic/contracts/generateBatchRequests' +import { getSpendingLimitContract, MULTI_SEND_ADDRESS } from 'src/logic/contracts/safeContracts' +import { SpendingLimit } from 'src/logic/safe/store/models/safe' +import { sameAddress, ZERO_ADDRESS } from 'src/logic/wallets/ethAddresses' +import { getWeb3, web3ReadOnly } from 'src/logic/wallets/getWeb3' +import { SPENDING_LIMIT_MODULE_ADDRESS } from 'src/utils/constants' +import { getEncodedMultiSendCallData, MultiSendTx } from './upgradeSafe' +import { fromTokenUnit } from 'src/logic/tokens/utils/humanReadableValue' +import { getBalanceAndDecimalsFromToken, GetTokenByAddress } from 'src/logic/tokens/utils/tokenHelpers' +import { sameString } from 'src/utils/strings' + +export const currentMinutes = (): number => Math.floor(Date.now() / (1000 * 60)) + +const requestTokensByDelegate = async ( + safeAddress: string, + delegates: string[], +): Promise<[string, string[] | undefined][]> => { + const batch = new web3ReadOnly.BatchRequest() + + const whenRequestValues = delegates.map((delegateAddress: string) => + generateBatchRequests<[string, string[] | undefined]>({ + abi: SpendingLimitModule.abi as AbiItem[], + address: SPENDING_LIMIT_MODULE_ADDRESS, + methods: [{ method: 'getTokens', args: [safeAddress, delegateAddress] }], + batch, + context: delegateAddress, + }), + ) + + batch.execute() + + return Promise.all(whenRequestValues) +} + +export type SpendingLimitRow = { + delegate: string + token: string + amount: string + spent: string + resetTimeMin: string + lastResetMin: string + nonce: string +} + +const ZERO_VALUE = '0' + +/** + * Deleted Allowance have their `amount` and `resetTime` set to `0` (zero) + * @param {SpendingLimitRow} allowance + * @returns boolean + */ +const discardZeroAllowance = ({ amount, resetTimeMin }: SpendingLimitRow): boolean => + !(sameString(amount, ZERO_VALUE) && sameString(resetTimeMin, ZERO_VALUE)) + +type TokenSpendingLimit = [string, string, string, string, string] + +type TokenSpendingLimitContext = { + delegate: string + token: string +} + +type TokenSpendingLimitRequest = [TokenSpendingLimitContext, TokenSpendingLimit | undefined] + +const requestAllowancesByDelegatesAndTokens = async ( + safeAddress: string, + tokensByDelegate: [string, string[] | undefined][], +): Promise => { + const batch = new web3ReadOnly.BatchRequest() + + const whenRequestValues: Promise[] = [] + + for (const [delegate, tokens] of tokensByDelegate) { + if (tokens) { + for (const token of tokens) { + whenRequestValues.push( + generateBatchRequests<[TokenSpendingLimitContext, TokenSpendingLimit]>({ + abi: SpendingLimitModule.abi as AbiItem[], + address: SPENDING_LIMIT_MODULE_ADDRESS, + methods: [{ method: 'getTokenAllowance', args: [safeAddress, delegate, token] }], + batch, + context: { delegate, token }, + }), + ) + } + } + } + + batch.execute() + + return Promise.all(whenRequestValues).then((allowances) => + allowances + // first, we filter out those records whose tokenSpendingLimit is undefined + .filter(([, tokenSpendingLimit]) => tokenSpendingLimit) + // then, we build the SpendingLimitRow object + .map(([{ delegate, token }, tokenSpendingLimit]) => { + const [amount, spent, resetTimeMin, lastResetMin, nonce] = tokenSpendingLimit as TokenSpendingLimit + + return { + delegate, + token, + amount, + spent, + resetTimeMin, + lastResetMin, + nonce, + } + }) + .filter(discardZeroAllowance), + ) +} + +export const getSpendingLimits = async ( + modules: string[] | undefined, + safeAddress: string, +): Promise => { + const isSpendingLimitEnabled = modules?.some((module) => sameAddress(module, SPENDING_LIMIT_MODULE_ADDRESS)) ?? false + + if (isSpendingLimitEnabled) { + const delegates = await getSpendingLimitContract().methods.getDelegates(safeAddress, 0, 100).call() + const tokensByDelegate = await requestTokensByDelegate(safeAddress, delegates.results) + return requestAllowancesByDelegatesAndTokens(safeAddress, tokensByDelegate) + } + + return null +} + +type DeleteAllowanceParams = { + beneficiary: string + tokenAddress: string +} + +export const getDeleteAllowanceTxData = ({ beneficiary, tokenAddress }: DeleteAllowanceParams): string => { + const { nativeCoin } = getNetworkInfo() + const token = sameAddress(tokenAddress, nativeCoin.address) ? ZERO_ADDRESS : tokenAddress + + const web3 = getWeb3() + const spendingLimitContract = new web3.eth.Contract( + SpendingLimitModule.abi as AbiItem[], + SPENDING_LIMIT_MODULE_ADDRESS, + ) + + return spendingLimitContract.methods.deleteAllowance(beneficiary, token).encodeABI() +} + +export const enableSpendingLimitModuleMultiSendTx = (safeAddress: string): MultiSendTx => { + const multiSendTx = enableModuleTx({ moduleAddress: SPENDING_LIMIT_MODULE_ADDRESS, safeAddress }) + + return { + to: multiSendTx.to, + value: Number(multiSendTx.valueInWei), + data: multiSendTx.txData as string, + operation: DELEGATE_CALL, + } +} + +export const addSpendingLimitBeneficiaryMultiSendTx = (beneficiary: string): MultiSendTx => { + const spendingLimitContract = getSpendingLimitContract() + + return { + to: SPENDING_LIMIT_MODULE_ADDRESS, + value: 0, + data: spendingLimitContract.methods.addDelegate(beneficiary).encodeABI(), + operation: DELEGATE_CALL, + } +} + +type SpendingLimitTxParams = { + spendingLimitArgs: { + beneficiary: string + token: string + spendingLimitInWei: string + resetTimeMin: number + resetBaseMin: number + } + safeAddress +} + +export const setSpendingLimitTx = ({ + spendingLimitArgs: { beneficiary, token, spendingLimitInWei, resetTimeMin, resetBaseMin }, + safeAddress, +}: SpendingLimitTxParams): CreateTransactionArgs => { + const spendingLimitContract = getSpendingLimitContract() + const { nativeCoin } = getNetworkInfo() + + return { + safeAddress, + to: SPENDING_LIMIT_MODULE_ADDRESS, + valueInWei: ZERO_VALUE, + txData: spendingLimitContract.methods + .setAllowance( + beneficiary, + token === nativeCoin.address ? ZERO_ADDRESS : token, + spendingLimitInWei, + resetTimeMin, + resetBaseMin, + ) + .encodeABI(), + operation: CALL, + notifiedTransaction: TX_NOTIFICATION_TYPES.NEW_SPENDING_LIMIT_TX, + } +} + +export const setSpendingLimitMultiSendTx = (args: SpendingLimitTxParams): MultiSendTx => { + const tx = setSpendingLimitTx(args) + + return { + to: tx.to, + value: Number(tx.valueInWei), + data: tx.txData as string, + operation: DELEGATE_CALL, + } +} + +type SpendingLimitMultiSendTx = { + transactions: Array + safeAddress: string +} +export const spendingLimitMultiSendTx = ({ + transactions, + safeAddress, +}: SpendingLimitMultiSendTx): CreateTransactionArgs => ({ + safeAddress, + to: MULTI_SEND_ADDRESS, + valueInWei: ZERO_VALUE, + txData: getEncodedMultiSendCallData(transactions, getWeb3()), + notifiedTransaction: TX_NOTIFICATION_TYPES.NEW_SPENDING_LIMIT_TX, + operation: DELEGATE_CALL, +}) + +type SpendingLimitAllowedBalance = GetTokenByAddress & { + tokenSpendingLimit: SpendingLimit +} + +/** + * Calculates the remaining amount available for a particular SpendingLimit + * @param {string} tokenAddress + * @param {SpendingLimit} tokenSpendingLimit + * @param {List} tokens + * returns string + */ +export const spendingLimitAllowedBalance = ({ + tokenAddress, + tokenSpendingLimit, + tokens, +}: SpendingLimitAllowedBalance): string | number => { + const token = getBalanceAndDecimalsFromToken({ tokenAddress, tokens }) + + if (!token) { + return 0 + } + + const { balance, decimals } = token + const diff = new BigNumber(tokenSpendingLimit.amount).minus(tokenSpendingLimit.spent).toString() + const diffInFPNotation = fromTokenUnit(diff, decimals) + + return new BigNumber(balance).gt(diffInFPNotation) ? diffInFPNotation : balance +} + +type GetSpendingLimitByTokenAddress = { + spendingLimits?: SpendingLimit[] | null + tokenAddress?: string +} + +/** + * Returns the SpendingLimit info for the specified tokenAddress + * @param {SpendingLimit[] | undefined | null} spendingLimits + * @param {string | undefined} tokenAddress + * @returns SpendingLimit | undefined + */ +export const getSpendingLimitByTokenAddress = ({ + spendingLimits, + tokenAddress, +}: GetSpendingLimitByTokenAddress): SpendingLimit | undefined => { + if (!tokenAddress || !spendingLimits) { + return + } + + const { nativeCoin } = getNetworkInfo() + + return spendingLimits.find(({ token: spendingLimitTokenAddress }) => { + spendingLimitTokenAddress = sameAddress(spendingLimitTokenAddress, ZERO_ADDRESS) + ? nativeCoin.address + : spendingLimitTokenAddress + return sameAddress(spendingLimitTokenAddress, tokenAddress) + }) +} diff --git a/src/logic/safe/utils/upgradeSafe.ts b/src/logic/safe/utils/upgradeSafe.ts index 3cd86610..4f3dea18 100644 --- a/src/logic/safe/utils/upgradeSafe.ts +++ b/src/logic/safe/utils/upgradeSafe.ts @@ -10,7 +10,7 @@ import { DELEGATE_CALL } from 'src/logic/safe/transactions' import { getWeb3 } from 'src/logic/wallets/getWeb3' import { MultiSend } from 'src/types/contracts/MultiSend.d' -interface MultiSendTx { +export interface MultiSendTx { operation: number to: string value: number diff --git a/src/logic/tokens/store/model/token.ts b/src/logic/tokens/store/model/token.ts index 933059aa..1657359c 100644 --- a/src/logic/tokens/store/model/token.ts +++ b/src/logic/tokens/store/model/token.ts @@ -6,7 +6,7 @@ export type TokenProps = { symbol: string decimals: number | string logoUri: string - balance?: number | string + balance: number | string } export const makeToken = Record({ @@ -15,7 +15,7 @@ export const makeToken = Record({ symbol: '', decimals: 0, logoUri: '', - balance: undefined, + balance: 0, }) // balance is only set in extendedSafeTokensSelector when we display user's token balances diff --git a/src/logic/tokens/utils/tokenHelpers.ts b/src/logic/tokens/utils/tokenHelpers.ts index c490819d..b1361467 100644 --- a/src/logic/tokens/utils/tokenHelpers.ts +++ b/src/logic/tokens/utils/tokenHelpers.ts @@ -1,3 +1,4 @@ +import { List } from 'immutable' import { AbiItem } from 'web3-utils' import { getNetworkInfo } from 'src/config' @@ -10,6 +11,7 @@ import { web3ReadOnly as web3 } from 'src/logic/wallets/getWeb3' import { isEmptyData } from 'src/logic/safe/store/actions/transactions/utils/transactionHelpers' import { TxServiceModel } from 'src/logic/safe/store/actions/transactions/fetchTransactions/loadOutgoingTransactions' import { CALL } from 'src/logic/safe/transactions' +import { sameAddress } from 'src/logic/wallets/ethAddresses' export const getEthAsToken = (balance: string | number): Token => { const { nativeCoin } = getNetworkInfo() @@ -82,3 +84,32 @@ export const isSendERC20Transaction = async (tx: TxServiceModel): Promise +} + +export type TokenFound = { + balance: string | number + decimals: string | number +} + +/** + * Finds and returns a Token object by the provided address + * @param {string} tokenAddress + * @param {List} tokens + * @returns Token | undefined + */ +export const getBalanceAndDecimalsFromToken = ({ tokenAddress, tokens }: GetTokenByAddress): TokenFound | undefined => { + const token = tokens?.find(({ address }) => sameAddress(address, tokenAddress)) + + if (!token) { + return + } + + return { + balance: token.balance ?? 0, + decimals: token.decimals ?? 0, + } +} diff --git a/src/routes/safe/components/Balances/SendModal/screens/AddressBookInput/index.tsx b/src/routes/safe/components/Balances/SendModal/screens/AddressBookInput/index.tsx index 2d520060..68ad183a 100644 --- a/src/routes/safe/components/Balances/SendModal/screens/AddressBookInput/index.tsx +++ b/src/routes/safe/components/Balances/SendModal/screens/AddressBookInput/index.tsx @@ -20,6 +20,7 @@ import { trimSpaces } from 'src/utils/strings' export interface AddressBookProps { fieldMutator: (address: string) => void + label?: string pristine?: boolean recipientAddress?: string setIsValidAddress: (valid: boolean) => void @@ -36,6 +37,7 @@ export interface BaseAddressBookInputProps extends AddressBookProps { const BaseAddressBookInput = ({ addressBookEntries, fieldMutator, + label = 'Recipient', setIsValidAddress, setSelectedEntry, setValidationText, @@ -137,7 +139,7 @@ const BaseAddressBookInput = ({ fullWidth id="filled-error-helper-text" variant="filled" - label={validationText ? validationText : 'Recipient'} + label={validationText ? validationText : label} InputLabelProps={{ shrink: true, required: true, classes: labelStyles }} InputProps={{ ...params.InputProps, classes: inputStyles }} /> diff --git a/src/routes/safe/components/Balances/SendModal/screens/ContractInteraction/SendCustomTx/index.tsx b/src/routes/safe/components/Balances/SendModal/screens/ContractInteraction/SendCustomTx/index.tsx index 837808a1..b06eb899 100644 --- a/src/routes/safe/components/Balances/SendModal/screens/ContractInteraction/SendCustomTx/index.tsx +++ b/src/routes/safe/components/Balances/SendModal/screens/ContractInteraction/SendCustomTx/index.tsx @@ -27,6 +27,7 @@ import { safeSelector } from 'src/logic/safe/store/selectors' import SafeInfo from 'src/routes/safe/components/Balances/SendModal/SafeInfo' import { ContractsAddressBookInput } from 'src/routes/safe/components/Balances/SendModal/screens/AddressBookInput' import { sm } from 'src/theme/variables' +import { sameString } from 'src/utils/strings' import ArrowDown from '../../assets/arrow-down.svg' @@ -147,7 +148,7 @@ const SendCustomTx: React.FC = ({ initialValues, onClose, onNext, contrac {selectedEntry && selectedEntry.address ? (
{ - if (e.key === 'Tab') { + if (sameString(e.key, 'Tab')) { return } setSelectedEntry(null) diff --git a/src/routes/safe/components/Balances/SendModal/screens/ReviewTx/index.tsx b/src/routes/safe/components/Balances/SendModal/screens/ReviewTx/index.tsx index 049121c8..17b0bcd7 100644 --- a/src/routes/safe/components/Balances/SendModal/screens/ReviewTx/index.tsx +++ b/src/routes/safe/components/Balances/SendModal/screens/ReviewTx/index.tsx @@ -1,7 +1,6 @@ import IconButton from '@material-ui/core/IconButton' import { makeStyles } from '@material-ui/core/styles' import Close from '@material-ui/icons/Close' -import { BigNumber } from 'bignumber.js' import React, { useEffect, useMemo, useState } from 'react' import { useDispatch, useSelector } from 'react-redux' import { toTokenUnit, fromTokenUnit } from 'src/logic/tokens/utils/humanReadableValue' @@ -16,17 +15,21 @@ import Hairline from 'src/components/layout/Hairline' import Img from 'src/components/layout/Img' import Paragraph from 'src/components/layout/Paragraph' import Row from 'src/components/layout/Row' +import { getSpendingLimitContract } from 'src/logic/contracts/safeContracts' import createTransaction from 'src/logic/safe/store/actions/createTransaction' import { safeSelector } from 'src/logic/safe/store/selectors' import { TX_NOTIFICATION_TYPES } from 'src/logic/safe/transactions' import { estimateTxGasCosts } from 'src/logic/safe/transactions/gas' import { getHumanFriendlyToken } from 'src/logic/tokens/store/actions/fetchTokens' import { formatAmount } from 'src/logic/tokens/utils/formatAmount' +import { sameAddress, ZERO_ADDRESS } from 'src/logic/wallets/ethAddresses' import { EMPTY_DATA } from 'src/logic/wallets/ethTransactions' import SafeInfo from 'src/routes/safe/components/Balances/SendModal/SafeInfo' import { setImageToPlaceholder } from 'src/routes/safe/components/Balances/utils' import { extendedSafeTokensSelector } from 'src/routes/safe/container/selector' +import { SpendingLimit } from 'src/logic/safe/store/models/safe' import { sm } from 'src/theme/variables' +import { sameString } from 'src/utils/strings' import ArrowDown from '../assets/arrow-down.svg' @@ -42,6 +45,8 @@ export type ReviewTxProp = { amount: string txRecipient: string token: string + txType?: string + tokenSpendingLimit?: SpendingLimit } type ReviewTxProps = { @@ -58,8 +63,8 @@ const ReviewTx = ({ onClose, onPrev, tx }: ReviewTxProps): React.ReactElement => const [gasCosts, setGasCosts] = useState('< 0.001') const [data, setData] = useState('') - const txToken = useMemo(() => tokens.find((token) => token.address === tx.token), [tokens, tx.token]) - const isSendingETH = txToken?.address === nativeCoin.address + const txToken = useMemo(() => tokens.find((token) => sameAddress(token.address, tx.token)), [tokens, tx.token]) + const isSendingETH = sameAddress(txToken?.address, nativeCoin.address) const txRecipient = isSendingETH ? tx.recipientAddress : txToken?.address useEffect(() => { @@ -75,8 +80,7 @@ const ReviewTx = ({ onClose, onPrev, tx }: ReviewTxProps): React.ReactElement => if (!isSendingETH) { const StandardToken = await getHumanFriendlyToken() const tokenInstance = await StandardToken.at(txToken.address as string) - const decimals = await tokenInstance.decimals() - const txAmount = new BigNumber(tx.amount).times(10 ** decimals.toNumber()).toString() + const txAmount = toTokenUnit(tx.amount, txToken.decimals) txData = tokenInstance.contract.methods.transfer(tx.recipientAddress, txAmount).encodeABI() } @@ -99,12 +103,34 @@ const ReviewTx = ({ onClose, onPrev, tx }: ReviewTxProps): React.ReactElement => }, [isSendingETH, safeAddress, tx.amount, tx.recipientAddress, txRecipient, txToken]) const submitTx = async () => { + const isSpendingLimit = sameString(tx.txType, 'spendingLimit') // txAmount should be 0 if we send tokens // the real value is encoded in txData and will be used by the contract // if txAmount > 0 it would send ETH from the Safe const txAmount = isSendingETH ? toTokenUnit(tx.amount, nativeCoin.decimals) : '0' - if (safeAddress) { + if (!safeAddress) { + console.error('There was an error trying to submit the transaction, the safeAddress was not found') + return + } + + if (isSpendingLimit && txToken && tx.tokenSpendingLimit) { + const spendingLimit = getSpendingLimitContract() + spendingLimit.methods + .executeAllowanceTransfer( + safeAddress, + sameAddress(txToken.address, nativeCoin.address) ? ZERO_ADDRESS : txToken.address, + tx.recipientAddress, + toTokenUnit(tx.amount, txToken.decimals), + ZERO_ADDRESS, + 0, + tx.tokenSpendingLimit.delegate, + EMPTY_DATA, + ) + .send({ from: tx.tokenSpendingLimit.delegate }) + .on('transactionHash', () => onClose()) + .catch(console.error) + } else { dispatch( createTransaction({ safeAddress: safeAddress, @@ -114,10 +140,8 @@ const ReviewTx = ({ onClose, onPrev, tx }: ReviewTxProps): React.ReactElement => notifiedTransaction: TX_NOTIFICATION_TYPES.STANDARD_TX, }), ) - } else { - console.error('There was an error trying to submit the transaction, the safeAddress was not found') + onClose() } - onClose() } return ( diff --git a/src/routes/safe/components/Balances/SendModal/screens/SendCollectible/index.tsx b/src/routes/safe/components/Balances/SendModal/screens/SendCollectible/index.tsx index e56bf7e4..fd1586c6 100644 --- a/src/routes/safe/components/Balances/SendModal/screens/SendCollectible/index.tsx +++ b/src/routes/safe/components/Balances/SendModal/screens/SendCollectible/index.tsx @@ -25,6 +25,7 @@ import { NFTToken } from 'src/logic/collectibles/sources/collectibles.d' import { getExplorerInfo } from 'src/config' import { sameAddress } from 'src/logic/wallets/ethAddresses' import { sm } from 'src/theme/variables' +import { sameString } from 'src/utils/strings' import ArrowDown from 'src/routes/safe/components/Balances/SendModal/screens/assets/arrow-down.svg' @@ -170,7 +171,7 @@ const SendCollectible = ({ {selectedEntry && selectedEntry.address ? (
{ - if (e.key === 'Tab') { + if (sameString(e.key, 'Tab')) { return } setSelectedEntry({ address: '', name: '' }) diff --git a/src/routes/safe/components/Balances/SendModal/screens/SendFunds/SpendingLimitRow.tsx b/src/routes/safe/components/Balances/SendModal/screens/SendFunds/SpendingLimitRow.tsx new file mode 100644 index 00000000..2474720a --- /dev/null +++ b/src/routes/safe/components/Balances/SendModal/screens/SendFunds/SpendingLimitRow.tsx @@ -0,0 +1,58 @@ +import { RadioButtons, Text } from '@gnosis.pm/safe-react-components' +import { BigNumber } from 'bignumber.js' +import React, { ReactElement, useMemo } from 'react' +import { useForm } from 'react-final-form' +import styled from 'styled-components' + +import Field from 'src/components/forms/Field' +import Col from 'src/components/layout/Col' +import Row from 'src/components/layout/Row' +import { SpendingLimit } from 'src/logic/safe/store/models/safe' +import { Token } from 'src/logic/tokens/store/model/token' +import { fromTokenUnit } from 'src/logic/tokens/utils/humanReadableValue' + +// TODO: propose refactor in safe-react-components based on this requirements +const SpendingLimitRadioButtons = styled(RadioButtons)` + & .MuiRadio-colorPrimary.Mui-checked { + color: ${({ theme }) => theme.colors.primary}; + } +` + +interface SpendingLimitRowProps { + tokenSpendingLimit: SpendingLimit + selectedToken: Token +} + +export const SpendingLimitRow = ({ tokenSpendingLimit, selectedToken }: SpendingLimitRowProps): ReactElement => { + const availableAmount = useMemo(() => { + return fromTokenUnit( + new BigNumber(tokenSpendingLimit.amount).minus(tokenSpendingLimit.spent).toString(), + selectedToken.decimals, + ) + }, [selectedToken.decimals, tokenSpendingLimit.amount, tokenSpendingLimit.spent]) + const { mutators } = useForm() + + return ( + + + Send as + + {({ input: { name, value } }) => ( + + )} + + + + ) +} diff --git a/src/routes/safe/components/Balances/SendModal/screens/SendFunds/TokenSelectField/index.tsx b/src/routes/safe/components/Balances/SendModal/screens/SendFunds/TokenSelectField/index.tsx index d33974ed..454cb121 100644 --- a/src/routes/safe/components/Balances/SendModal/screens/SendFunds/TokenSelectField/index.tsx +++ b/src/routes/safe/components/Balances/SendModal/screens/SendFunds/TokenSelectField/index.tsx @@ -1,21 +1,27 @@ +import { Text } from '@gnosis.pm/safe-react-components' import ListItemIcon from '@material-ui/core/ListItemIcon' import ListItemText from '@material-ui/core/ListItemText' import MenuItem from '@material-ui/core/MenuItem' -import { withStyles } from '@material-ui/core/styles' -import React from 'react' - -import { selectStyles, selectedTokenStyles } from './style' +import { List } from 'immutable' +import React, { ReactElement } from 'react' import Field from 'src/components/forms/Field' import SelectField from 'src/components/forms/SelectField' import { required } from 'src/components/forms/validator' import Img from 'src/components/layout/Img' -import Paragraph from 'src/components/layout/Paragraph' - import { formatAmount } from 'src/logic/tokens/utils/formatAmount' import { setImageToPlaceholder } from 'src/routes/safe/components/Balances/utils' +import { Token } from 'src/logic/tokens/store/model/token' -const SelectedToken = ({ classes, tokenAddress, tokens }) => { +import { useSelectStyles, useSelectedTokenStyles } from './style' + +interface SelectTokenProps { + tokenAddress: string + tokens: List +} + +const SelectedToken = ({ tokenAddress, tokens }: SelectTokenProps): ReactElement => { + const classes = useSelectedTokenStyles() const token = tokens.find(({ address }) => address === tokenAddress) return ( @@ -28,43 +34,52 @@ const SelectedToken = ({ classes, tokenAddress, tokens }) => { ) : ( - + Select an asset* - + )} ) } -const SelectedTokenStyled = withStyles(selectedTokenStyles)(SelectedToken) -const TokenSelectField = ({ classes, initialValue, isValid, tokens }) => ( - } - validate={required} - > - {tokens.map((token) => ( - - - {token.name} - - - - ))} - -) +interface TokenSelectFieldProps { + initialValue?: string + isValid?: boolean + tokens: List +} -export default withStyles(selectStyles)(TokenSelectField) +const TokenSelectField = ({ initialValue, isValid = true, tokens }: TokenSelectFieldProps): ReactElement => { + const classes = useSelectStyles() + + return ( + } + validate={required} + > + {tokens.map((token) => ( + + + {token.name} + + + + ))} + + ) +} + +export default TokenSelectField diff --git a/src/routes/safe/components/Balances/SendModal/screens/SendFunds/TokenSelectField/style.ts b/src/routes/safe/components/Balances/SendModal/screens/SendFunds/TokenSelectField/style.ts index 561dd169..9b6f874b 100644 --- a/src/routes/safe/components/Balances/SendModal/screens/SendFunds/TokenSelectField/style.ts +++ b/src/routes/safe/components/Balances/SendModal/screens/SendFunds/TokenSelectField/style.ts @@ -1,23 +1,29 @@ +import { createStyles, makeStyles } from '@material-ui/core' + import { sm } from 'src/theme/variables' -export const selectedTokenStyles = () => ({ - container: { - minHeight: '55px', - padding: 0, - width: '100%', - }, - tokenData: { - padding: 0, - margin: 0, - lineHeight: '14px', - }, - tokenImage: { - marginRight: sm, - }, -}) +export const useSelectedTokenStyles = makeStyles( + createStyles({ + container: { + minHeight: '55px', + padding: 0, + width: '100%', + }, + tokenData: { + padding: 0, + margin: 0, + lineHeight: '14px', + }, + tokenImage: { + marginRight: sm, + }, + }), +) -export const selectStyles = () => ({ - selectMenu: { - paddingRight: 0, - }, -}) +export const useSelectStyles = makeStyles( + createStyles({ + selectMenu: { + paddingRight: 0, + }, + }), +) diff --git a/src/routes/safe/components/Balances/SendModal/screens/SendFunds/index.tsx b/src/routes/safe/components/Balances/SendModal/screens/SendFunds/index.tsx index 4fa961ab..f8b3c7ce 100644 --- a/src/routes/safe/components/Balances/SendModal/screens/SendFunds/index.tsx +++ b/src/routes/safe/components/Balances/SendModal/screens/SendFunds/index.tsx @@ -2,11 +2,11 @@ import IconButton from '@material-ui/core/IconButton' import InputAdornment from '@material-ui/core/InputAdornment' import { makeStyles } from '@material-ui/core/styles' import Close from '@material-ui/icons/Close' -import { getExplorerInfo, getNetworkInfo } from 'src/config' -import React, { useEffect, useState } from 'react' -import { OnChange } from 'react-final-form-listeners' +import { BigNumber } from 'bignumber.js' +import React, { ReactElement, useEffect, useState } from 'react' import { useSelector } from 'react-redux' +import { getExplorerInfo } from 'src/config' import Field from 'src/components/forms/Field' import GnoForm from 'src/components/forms/GnoForm' import TextField from 'src/components/forms/TextField' @@ -22,17 +22,25 @@ import { ScanQRWrapper } from 'src/components/ScanQRModal/ScanQRWrapper' import { addressBookSelector } from 'src/logic/addressBook/store/selectors' import { getNameFromAddressBook } from 'src/logic/addressBook/utils' import { sameAddress } from 'src/logic/wallets/ethAddresses' +import { SpendingLimit } from 'src/logic/safe/store/models/safe' +import { userAccountSelector } from 'src/logic/wallets/store/selectors' import SafeInfo from 'src/routes/safe/components/Balances/SendModal/SafeInfo' import { AddressBookInput } from 'src/routes/safe/components/Balances/SendModal/screens/AddressBookInput' +import { SpendingLimitRow } from 'src/routes/safe/components/Balances/SendModal/screens/SendFunds/SpendingLimitRow' import TokenSelectField from 'src/routes/safe/components/Balances/SendModal/screens/SendFunds/TokenSelectField' +import { fromTokenUnit } from 'src/logic/tokens/utils/humanReadableValue' import { extendedSafeTokensSelector } from 'src/routes/safe/container/selector' +import { safeSpendingLimitsSelector } from 'src/logic/safe/store/selectors' import { sm } from 'src/theme/variables' +import { sameString } from 'src/utils/strings' import ArrowDown from '../assets/arrow-down.svg' import { styles } from './style' import { EthHashInfo } from '@gnosis.pm/safe-react-components' +import { spendingLimitAllowedBalance, getSpendingLimitByTokenAddress } from 'src/logic/safe/utils/spendingLimits' +import { getBalanceAndDecimalsFromToken } from 'src/logic/tokens/utils/tokenHelpers' const formMutators = { setMax: (args, state, utils) => { @@ -44,10 +52,21 @@ const formMutators = { setRecipient: (args, state, utils) => { utils.changeValue(state, 'recipientAddress', () => args[0]) }, + setTxType: (args, state, utils) => { + utils.changeValue(state, 'txType', () => args[0]) + }, } const useStyles = makeStyles(styles) +export type SendFundsTx = { + amount?: string + recipientAddress?: string + token?: string + txType?: string + tokenSpendingLimit?: SpendingLimit +} + type SendFundsProps = { onClose: () => void onNext: (txInfo: unknown) => void @@ -56,15 +75,7 @@ type SendFundsProps = { amount?: string } -const { nativeCoin } = getNetworkInfo() - -const SendFunds = ({ - onClose, - onNext, - recipientAddress, - selectedToken = '', - amount, -}: SendFundsProps): React.ReactElement => { +const SendFunds = ({ onClose, onNext, recipientAddress, selectedToken = '', amount }: SendFundsProps): ReactElement => { const classes = useStyles() const tokens = useSelector(extendedSafeTokensSelector) const addressBook = useSelector(addressBookSelector) @@ -97,13 +108,42 @@ const SendFunds = ({ } }, [selectedEntry, pristine]) + let tokenSpendingLimit const handleSubmit = (values) => { const submitValues = values // If the input wasn't modified, there was no mutation of the recipientAddress if (!values.recipientAddress) { submitValues.recipientAddress = selectedEntry?.address } - onNext(submitValues) + onNext({ ...submitValues, tokenSpendingLimit }) + } + + const spendingLimits = useSelector(safeSpendingLimitsSelector) + const currentUser = useSelector(userAccountSelector) + + const sendFundsValidation = (values) => { + const { amount, token: tokenAddress, txType } = values ?? {} + + if (!amount || !tokenAddress) { + return + } + + const isSpendingLimit = tokenSpendingLimit && txType === 'spendingLimit' + + const amountValidation = composeValidators( + required, + mustBeFloat, + minValue(0, false), + maxValue( + isSpendingLimit + ? spendingLimitAllowedBalance({ tokenAddress, tokenSpendingLimit, tokens }) + : getBalanceAndDecimalsFromToken({ tokenAddress, tokens })?.balance ?? 0, + ), + )(amount) + + return { + amount: amountValidation, + } } return ( @@ -122,12 +162,19 @@ const SendFunds = ({ formMutators={formMutators} initialValues={{ amount, recipientAddress, token: selectedToken }} onSubmit={handleSubmit} + validation={sendFundsValidation} > {(...args) => { const formState = args[2] const mutators = args[3] - const { token: tokenAddress } = formState.values - const selectedTokenRecord = tokens.find((token) => token.address === tokenAddress) + const { token: tokenAddress, txType } = formState.values + const selectedToken = tokens?.find((token) => token.address === tokenAddress) + const userSpendingLimits = spendingLimits?.filter(({ delegate }) => sameAddress(delegate, currentUser)) + + tokenSpendingLimit = getSpendingLimitByTokenAddress({ + spendingLimits: userSpendingLimits, + tokenAddress: selectedToken?.address, + }) const handleScan = (value, closeQrModal) => { let scannedAddress = value @@ -149,6 +196,22 @@ const SendFunds = ({ shouldDisableSubmitButton = !selectedEntry.address } + const setMaxAllowedAmount = () => { + const isSpendingLimit = tokenSpendingLimit && txType === 'spendingLimit' + let maxAmount = selectedToken?.balance ?? 0 + + if (isSpendingLimit) { + const spendingLimitBalance = fromTokenUnit( + new BigNumber(tokenSpendingLimit.amount).minus(tokenSpendingLimit.spent).toString(), + selectedToken?.decimals ?? 0, + ) + + maxAmount = new BigNumber(maxAmount).gt(spendingLimitBalance) ? spendingLimitBalance : maxAmount + } + + mutators.setMax(maxAmount) + } + return ( <> @@ -164,7 +227,7 @@ const SendFunds = ({ {selectedEntry && selectedEntry.address ? (
{ - if (e.key === 'Tab') { + if (sameString(e.key, 'Tab')) { return } setSelectedEntry({ address: '', name: '' }) @@ -208,22 +271,21 @@ const SendFunds = ({ + {tokenSpendingLimit && selectedToken && ( + + )} Amount - mutators.setMax(selectedTokenRecord?.balance)} - weight="bold" - testId="send-max-btn" - > + Send max @@ -232,24 +294,15 @@ const SendFunds = ({ {selectedTokenRecord.symbol}, - } - } + inputAdornment={{ + endAdornment: {selectedToken?.symbol}, + }} name="amount" placeholder="Amount*" text="Amount*" type="text" testId="amount-input" - validate={composeValidators( - required, - mustBeFloat, - minValue(0, false), - maxValue(selectedTokenRecord?.balance || 0), - )} /> - {() => mutators.onTokenChange()} @@ -262,7 +315,7 @@ const SendFunds = ({ className={classes.submitButton} color="primary" data-testid="review-tx-btn" - disabled={shouldDisableSubmitButton} + disabled={!formState.valid || shouldDisableSubmitButton} minWidth={140} type="submit" variant="contained" diff --git a/src/routes/safe/components/Settings/SpendingLimit/FormFields/Amount.tsx b/src/routes/safe/components/Settings/SpendingLimit/FormFields/Amount.tsx new file mode 100644 index 00000000..d2f41fb8 --- /dev/null +++ b/src/routes/safe/components/Settings/SpendingLimit/FormFields/Amount.tsx @@ -0,0 +1,57 @@ +import { TextField as SRCTextField } from '@gnosis.pm/safe-react-components' +import React, { ReactElement } from 'react' +import { useField } from 'react-final-form' +import { useSelector } from 'react-redux' +import styled from 'styled-components' + +import GnoField from 'src/components/forms/Field' +import { composeValidators, minValue, mustBeFloat, required } from 'src/components/forms/validator' +import { extendedSafeTokensSelector } from 'src/routes/safe/container/selector' +import { useStyles } from 'src/routes/safe/components/Settings/SpendingLimit/style' + +export const Field = styled(GnoField)` + margin: 8px 0; + width: 100%; +` + +const AmountInput = styled.div` + grid-area: amountInput; +` + +const TextField = styled(SRCTextField)` + margin: 0; +` + +const Amount = (): ReactElement => { + const classes = useStyles() + + const { + input: { value: tokenAddress }, + } = useField('token', { subscription: { value: true } }) + const { + meta: { touched, visited }, + } = useField('amount', { subscription: { touched: true, visited: true } }) + + const tokens = useSelector(extendedSafeTokensSelector) + + const selectedTokenRecord = tokens.find((token) => token.address === tokenAddress) + + const validate = (touched || visited) && composeValidators(required, mustBeFloat, minValue(0, false)) + + return ( + + + + ) +} + +export default Amount diff --git a/src/routes/safe/components/Settings/SpendingLimit/FormFields/Beneficiary.tsx b/src/routes/safe/components/Settings/SpendingLimit/FormFields/Beneficiary.tsx new file mode 100644 index 00000000..0e960d6e --- /dev/null +++ b/src/routes/safe/components/Settings/SpendingLimit/FormFields/Beneficiary.tsx @@ -0,0 +1,108 @@ +import { EthHashInfo } from '@gnosis.pm/safe-react-components' +import React, { KeyboardEvent, ReactElement, useEffect, useState } from 'react' +import { useForm, useFormState } from 'react-final-form' +import { useSelector } from 'react-redux' +import styled from 'styled-components' + +import { ScanQRWrapper } from 'src/components/ScanQRModal/ScanQRWrapper' +import { getExplorerInfo } from 'src/config' +import { addressBookSelector } from 'src/logic/addressBook/store/selectors' +import { getNameFromAddressBook } from 'src/logic/addressBook/utils' +import { AddressBookInput } from 'src/routes/safe/components/Balances/SendModal/screens/AddressBookInput' +import { sameString } from 'src/utils/strings' + +const BeneficiaryInput = styled.div` + grid-area: beneficiaryInput; +` + +const BeneficiaryScan = styled.div` + grid-area: beneficiaryScan; +` + +const Beneficiary = (): ReactElement => { + const { initialValues } = useFormState() + const { mutators } = useForm() + + const [selectedEntry, setSelectedEntry] = useState<{ address?: string; name?: string } | null>({ + address: initialValues?.beneficiary || '', + name: '', + }) + + const [pristine, setPristine] = useState(!initialValues?.beneficiary) + + useEffect(() => { + if (selectedEntry === null) { + mutators?.setBeneficiary?.('') + + if (pristine) { + setPristine(false) + } + } + }, [mutators, pristine, selectedEntry]) + + const addressBook = useSelector(addressBookSelector) + + const handleScan = (value, closeQrModal) => { + const scannedAddress = value.startsWith('ethereum:') ? value.replace('ethereum:', '') : value + const scannedName = addressBook + ? getNameFromAddressBook(addressBook, scannedAddress, { filterOnlyValidName: true }) ?? '' + : '' + + mutators?.setBeneficiary?.(scannedAddress) + + setSelectedEntry({ + name: scannedName, + address: scannedAddress, + }) + + closeQrModal() + } + + const handleOnKeyDown = (e: KeyboardEvent): void => { + if (sameString(e.key, 'Tab')) { + return + } + setSelectedEntry(null) + } + + const handleOnClick = () => { + setSelectedEntry(null) + } + + return selectedEntry?.address ? ( + + + + ) : ( + <> + + {}} + label="Beneficiary" + /> + + + + + + ) +} + +export default Beneficiary diff --git a/src/routes/safe/components/Settings/SpendingLimit/FormFields/ResetTime.tsx b/src/routes/safe/components/Settings/SpendingLimit/FormFields/ResetTime.tsx new file mode 100644 index 00000000..5cb4897b --- /dev/null +++ b/src/routes/safe/components/Settings/SpendingLimit/FormFields/ResetTime.tsx @@ -0,0 +1,118 @@ +import { RadioButtons, Text } from '@gnosis.pm/safe-react-components' +import { FormControlLabel, hexToRgb, Switch as SwitchMui } from '@material-ui/core' +import React, { ReactElement } from 'react' +import { useField } from 'react-final-form' +import styled from 'styled-components' + +import { Field } from 'src/routes/safe/components/Settings/SpendingLimit/FormFields/Amount' + +// TODO: propose refactor in safe-react-components based on this requirements +const SpendingLimitRadioButtons = styled(RadioButtons)` + & .MuiRadio-colorPrimary.Mui-checked { + color: ${({ theme }) => theme.colors.primary}; + } +` + +// TODO: add `name` and `value` to SRC Switch, as they're required for a better RFF integration +const StyledSwitch = styled(({ ...rest }) => )` + && { + .MuiIconButton-label, + .MuiSwitch-colorSecondary { + color: ${({ theme }) => theme.colors.icon}; + } + + .MuiSwitch-colorSecondary.Mui-checked .MuiIconButton-label { + color: ${({ theme }) => theme.colors.primary}; + } + + .MuiSwitch-colorSecondary.Mui-checked:hover { + background-color: ${({ theme }) => hexToRgb(`${theme.colors.primary}03`)}; + } + + .Mui-checked + .MuiSwitch-track { + background-color: ${({ theme }) => theme.colors.primaryLight}; + } + } +` + +interface RadioButtonOption { + label: string + value: string +} + +interface RadioButtonProps { + options: RadioButtonOption[] + initialValue: string + groupName: string +} + +const SafeRadioButtons = ({ options, initialValue, groupName }: RadioButtonProps): ReactElement => ( + + {({ input: { name, value, onChange } }) => ( + + )} + +) + +const Switch = ({ label, name }: { label: string; name: string }): ReactElement => ( + ( + + )} + /> + } + /> +) + +const ResetTimeLabel = styled.div` + grid-area: resetTimeLabel; +` + +const ResetTimeToggle = styled.div` + grid-area: resetTimeToggle; +` + +const ResetTimeOptions = styled.div` + grid-area: resetTimeOption; +` + +export const RESET_TIME_OPTIONS = [ + { label: '1 day', value: '1' }, + { label: '1 week', value: '7' }, + { label: '1 month', value: '30' }, +] + +const ResetTime = (): ReactElement => { + const { + input: { value: withResetTime }, + } = useField('withResetTime', { subscription: { value: true } }) + + const switchExplanation = withResetTime ? 'choose reset time period' : 'one time' + + return ( + <> + + Set a reset time so the allowance automatically refills after the defined time period. + + + + + {withResetTime && ( + + + + )} + + ) +} + +export default ResetTime diff --git a/src/routes/safe/components/Settings/SpendingLimit/FormFields/Token.tsx b/src/routes/safe/components/Settings/SpendingLimit/FormFields/Token.tsx new file mode 100644 index 00000000..1e386093 --- /dev/null +++ b/src/routes/safe/components/Settings/SpendingLimit/FormFields/Token.tsx @@ -0,0 +1,22 @@ +import React, { ReactElement } from 'react' +import { useSelector } from 'react-redux' +import styled from 'styled-components' + +import TokenSelectField from 'src/routes/safe/components/Balances/SendModal/screens/SendFunds/TokenSelectField' +import { extendedSafeTokensSelector } from 'src/routes/safe/container/selector' + +const TokenInput = styled.div` + grid-area: tokenInput; +` + +const Token = (): ReactElement => { + const tokens = useSelector(extendedSafeTokensSelector) + + return ( + + + + ) +} + +export default Token diff --git a/src/routes/safe/components/Settings/SpendingLimit/FormFields/index.ts b/src/routes/safe/components/Settings/SpendingLimit/FormFields/index.ts new file mode 100644 index 00000000..555ac537 --- /dev/null +++ b/src/routes/safe/components/Settings/SpendingLimit/FormFields/index.ts @@ -0,0 +1,6 @@ +import Amount from './Amount' +import Beneficiary from './Beneficiary' +import ResetTime from './ResetTime' +import Token from './Token' + +export { Amount, Beneficiary, ResetTime, Token } diff --git a/src/routes/safe/components/Settings/SpendingLimit/InfoDisplay/AddressInfo.tsx b/src/routes/safe/components/Settings/SpendingLimit/InfoDisplay/AddressInfo.tsx new file mode 100644 index 00000000..9e98c1fc --- /dev/null +++ b/src/routes/safe/components/Settings/SpendingLimit/InfoDisplay/AddressInfo.tsx @@ -0,0 +1,36 @@ +import { EthHashInfo } from '@gnosis.pm/safe-react-components' +import React, { ReactElement } from 'react' +import { useSelector } from 'react-redux' + +import { getExplorerInfo } from 'src/config' +import { getNameFromAddressBookSelector } from 'src/logic/addressBook/store/selectors' +import { sameString } from 'src/utils/strings' + +import DataDisplay from './DataDisplay' + +interface AddressInfoProps { + address: string + cut?: number + title?: string +} + +const AddressInfo = ({ address, cut = 4, title }: AddressInfoProps): ReactElement => { + const name = useSelector((state) => getNameFromAddressBookSelector(state, address)) + const explorerUrl = getExplorerInfo(address) + + return ( + + + + ) +} + +export default AddressInfo diff --git a/src/routes/safe/components/Settings/SpendingLimit/InfoDisplay/DataDisplay.tsx b/src/routes/safe/components/Settings/SpendingLimit/InfoDisplay/DataDisplay.tsx new file mode 100644 index 00000000..71c342d4 --- /dev/null +++ b/src/routes/safe/components/Settings/SpendingLimit/InfoDisplay/DataDisplay.tsx @@ -0,0 +1,20 @@ +import { Text } from '@gnosis.pm/safe-react-components' +import React, { ReactElement } from 'react' + +interface GenericInfoProps { + title?: string + children: React.ReactNode +} + +const DataDisplay = ({ title, children }: GenericInfoProps): ReactElement => ( + <> + {title && ( + + {title} + + )} + {children} + +) + +export default DataDisplay diff --git a/src/routes/safe/components/Settings/SpendingLimit/InfoDisplay/ResetTimeInfo.tsx b/src/routes/safe/components/Settings/SpendingLimit/InfoDisplay/ResetTimeInfo.tsx new file mode 100644 index 00000000..ad0e7ef8 --- /dev/null +++ b/src/routes/safe/components/Settings/SpendingLimit/InfoDisplay/ResetTimeInfo.tsx @@ -0,0 +1,29 @@ +import { IconText, Text } from '@gnosis.pm/safe-react-components' +import React, { ReactElement } from 'react' + +import Row from 'src/components/layout/Row' + +import DataDisplay from './DataDisplay' + +interface ResetTimeInfoProps { + title?: string + label?: string +} + +const ResetTimeInfo = ({ title, label }: ResetTimeInfoProps): ReactElement => { + return ( + + {label ? ( + + + + ) : ( + + One-time spending limit + + )} + + ) +} + +export default ResetTimeInfo diff --git a/src/routes/safe/components/Settings/SpendingLimit/InfoDisplay/TokenInfo.tsx b/src/routes/safe/components/Settings/SpendingLimit/InfoDisplay/TokenInfo.tsx new file mode 100644 index 00000000..b9a0d36e --- /dev/null +++ b/src/routes/safe/components/Settings/SpendingLimit/InfoDisplay/TokenInfo.tsx @@ -0,0 +1,40 @@ +import { Text } from '@gnosis.pm/safe-react-components' +import React, { ReactElement } from 'react' +import styled from 'styled-components' + +import { Token } from 'src/logic/tokens/store/model/token' +import { setImageToPlaceholder } from 'src/routes/safe/components/Balances/utils' + +import DataDisplay from './DataDisplay' + +const StyledImage = styled.img` + width: 32px; + height: 32px; + object-fit: contain; + margin: 0 8px 0 0; +` +const StyledImageName = styled.div` + display: flex; + align-items: center; +` + +interface TokenInfoProps { + amount: string + title?: string + token: Token +} + +const TokenInfo = ({ amount, title, token }: TokenInfoProps): ReactElement => { + return ( + + + + + {amount} {token.symbol} + + + + ) +} + +export default TokenInfo diff --git a/src/routes/safe/components/Settings/SpendingLimit/InfoDisplay/index.ts b/src/routes/safe/components/Settings/SpendingLimit/InfoDisplay/index.ts new file mode 100644 index 00000000..2d6b7eb1 --- /dev/null +++ b/src/routes/safe/components/Settings/SpendingLimit/InfoDisplay/index.ts @@ -0,0 +1,6 @@ +import AddressInfo from './AddressInfo' +import ResetTimeInfo from './ResetTimeInfo' +import TokenInfo from './TokenInfo' + +export { AddressInfo, ResetTimeInfo, TokenInfo } +export default './DataDisplay' diff --git a/src/routes/safe/components/Settings/SpendingLimit/LimitsTable/SpentVsAmount.tsx b/src/routes/safe/components/Settings/SpendingLimit/LimitsTable/SpentVsAmount.tsx new file mode 100644 index 00000000..eb2f849a --- /dev/null +++ b/src/routes/safe/components/Settings/SpendingLimit/LimitsTable/SpentVsAmount.tsx @@ -0,0 +1,59 @@ +import { Text } from '@gnosis.pm/safe-react-components' +import React, { ReactElement, useMemo } from 'react' +import styled from 'styled-components' + +import { Token } from 'src/logic/tokens/store/model/token' +import { formatAmount } from 'src/logic/tokens/utils/formatAmount' +import { setImageToPlaceholder } from 'src/routes/safe/components/Balances/utils' +import useTokenInfo from 'src/logic/safe/hooks/useTokenInfo' +import { fromTokenUnit } from 'src/logic/tokens/utils/humanReadableValue' +import { useWindowDimensions } from 'src/logic/hooks/useWindowDimensions' + +const StyledImage = styled.img` + width: 32px; + height: 32px; + object-fit: contain; + margin: 0 8px 0 0; +` + +const StyledImageName = styled.div` + display: flex; + align-items: center; +` + +type FormattedAmountsProps = { amount: string; spent: string; tokenInfo?: Token } + +type FormattedAmounts = { amount: string; spent: string } + +const useFormattedAmounts = ({ amount, spent, tokenInfo }: FormattedAmountsProps): FormattedAmounts | undefined => { + return useMemo(() => { + if (tokenInfo) { + const formattedSpent = formatAmount(fromTokenUnit(spent, tokenInfo.decimals)).toString() + const formattedAmount = formatAmount(fromTokenUnit(amount, tokenInfo.decimals)).toString() + return { amount: formattedAmount, spent: formattedSpent } + } + }, [amount, spent, tokenInfo]) +} + +interface SpentVsAmountProps { + amount: string + spent: string + tokenAddress: string +} + +const SpentVsAmount = ({ amount, spent, tokenAddress }: SpentVsAmountProps): ReactElement | null => { + const { width } = useWindowDimensions() + const showIcon = useMemo(() => width > 1024, [width]) + + const tokenInfo = useTokenInfo(tokenAddress) + const spentInfo = useFormattedAmounts({ amount, spent, tokenInfo }) + + return spentInfo && tokenInfo ? ( + + {showIcon && } + {`${spentInfo.spent} of ${spentInfo.amount} ${tokenInfo.symbol}`} + + ) : null +} + +export default SpentVsAmount diff --git a/src/routes/safe/components/Settings/SpendingLimit/LimitsTable/dataFetcher.ts b/src/routes/safe/components/Settings/SpendingLimit/LimitsTable/dataFetcher.ts new file mode 100644 index 00000000..501fe0bf --- /dev/null +++ b/src/routes/safe/components/Settings/SpendingLimit/LimitsTable/dataFetcher.ts @@ -0,0 +1,78 @@ +import { List } from 'immutable' + +import { TableColumn } from 'src/components/Table/types.d' +import { SpendingLimitRow } from 'src/logic/safe/utils/spendingLimits' +import { relativeTime } from 'src/utils/date' + +export const SPENDING_LIMIT_TABLE_BENEFICIARY_ID = 'beneficiary' +export const SPENDING_LIMIT_TABLE_SPENT_ID = 'spent' +export const SPENDING_LIMIT_TABLE_RESET_TIME_ID = 'resetTime' +export const SPENDING_LIMIT_TABLE_ACTION_ID = 'action' + +export type SpendingLimitTable = { + [SPENDING_LIMIT_TABLE_BENEFICIARY_ID]: string + [SPENDING_LIMIT_TABLE_SPENT_ID]: { + spent: string + amount: string + tokenAddress: string + } + [SPENDING_LIMIT_TABLE_RESET_TIME_ID]: { + relativeTime: string + lastResetMin: string + resetTimeMin: string + } +} + +export const getSpendingLimitData = (spendingLimits?: SpendingLimitRow[] | null): SpendingLimitTable[] | undefined => + spendingLimits?.map((spendingLimit) => ({ + [SPENDING_LIMIT_TABLE_BENEFICIARY_ID]: spendingLimit.delegate, + [SPENDING_LIMIT_TABLE_SPENT_ID]: { + spent: spendingLimit.spent, + amount: spendingLimit.amount, + tokenAddress: spendingLimit.token, + }, + [SPENDING_LIMIT_TABLE_RESET_TIME_ID]: { + relativeTime: relativeTime(spendingLimit.lastResetMin, spendingLimit.resetTimeMin), + lastResetMin: spendingLimit.lastResetMin, + resetTimeMin: spendingLimit.resetTimeMin, + }, + })) + +export const generateColumns = (): List => { + const beneficiaryColumn: TableColumn = { + align: 'left', + custom: false, + disablePadding: false, + id: SPENDING_LIMIT_TABLE_BENEFICIARY_ID, + label: 'Beneficiary', + order: false, + } + + const spentColumn: TableColumn = { + align: 'left', + custom: false, + disablePadding: false, + id: SPENDING_LIMIT_TABLE_SPENT_ID, + label: 'Spent', + order: false, + } + + const resetColumn: TableColumn = { + align: 'left', + custom: false, + disablePadding: false, + id: SPENDING_LIMIT_TABLE_RESET_TIME_ID, + label: 'Reset Time', + order: false, + } + + const actionsColumn: TableColumn = { + custom: true, + disablePadding: false, + id: SPENDING_LIMIT_TABLE_ACTION_ID, + label: '', + order: false, + } + + return List([beneficiaryColumn, spentColumn, resetColumn, actionsColumn]) +} diff --git a/src/routes/safe/components/Settings/SpendingLimit/LimitsTable/index.tsx b/src/routes/safe/components/Settings/SpendingLimit/LimitsTable/index.tsx new file mode 100644 index 00000000..6717bfb1 --- /dev/null +++ b/src/routes/safe/components/Settings/SpendingLimit/LimitsTable/index.tsx @@ -0,0 +1,110 @@ +import { Button, Text } from '@gnosis.pm/safe-react-components' +import TableContainer from '@material-ui/core/TableContainer' +import cn from 'classnames' +import React, { ReactElement, useState } from 'react' +import { useSelector } from 'react-redux' +import styled from 'styled-components' + +import Row from 'src/components/layout/Row' +import { TableCell, TableRow } from 'src/components/layout/Table' +import Table from 'src/components/Table' +import { AddressInfo } from 'src/routes/safe/components/Settings/SpendingLimit/InfoDisplay' +import RemoveLimitModal from 'src/routes/safe/components/Settings/SpendingLimit/RemoveLimitModal' +import { useStyles } from 'src/routes/safe/components/Settings/SpendingLimit/style' +import { grantedSelector } from 'src/routes/safe/container/selector' + +import { + generateColumns, + SPENDING_LIMIT_TABLE_BENEFICIARY_ID, + SPENDING_LIMIT_TABLE_RESET_TIME_ID, + SPENDING_LIMIT_TABLE_SPENT_ID, + SpendingLimitTable, +} from './dataFetcher' +import SpentVsAmount from './SpentVsAmount' + +const TableActionButton = styled(Button)` + background-color: transparent; + padding: 0; + + &:hover { + background-color: transparent; + } +` + +interface SpendingLimitTableProps { + data?: SpendingLimitTable[] +} + +const LimitsTable = ({ data }: SpendingLimitTableProps): ReactElement => { + const classes = useStyles() + const granted = useSelector(grantedSelector) + + const columns = generateColumns() + const autoColumns = columns.filter(({ custom }) => !custom) + + const [selectedRow, setSelectedRow] = useState() + + return ( + <> + + + {(sortedData) => + sortedData.map((row, index) => ( + = 3 && index === sortedData.size - 1 && classes.noBorderBottom)} + data-testid="spending-limit-table-row" + key={index} + tabIndex={-1} + > + {autoColumns.map((column, index) => { + const columnId = column.id + const rowElement = row[columnId] + + return ( + + {columnId === SPENDING_LIMIT_TABLE_BENEFICIARY_ID && } + {columnId === SPENDING_LIMIT_TABLE_SPENT_ID && } + {columnId === SPENDING_LIMIT_TABLE_RESET_TIME_ID && ( + {rowElement.relativeTime} + )} + + ) + })} + + + {granted && ( + setSelectedRow(row)} + data-testid="remove-action" + > + {null} + + )} + + + + )) + } +
+
+ {selectedRow && ( + setSelectedRow(undefined)} spendingLimit={selectedRow} open={true} /> + )} + + ) +} + +export default LimitsTable diff --git a/src/routes/safe/components/Settings/SpendingLimit/Modal/index.tsx b/src/routes/safe/components/Settings/SpendingLimit/Modal/index.tsx new file mode 100644 index 00000000..b546f02f --- /dev/null +++ b/src/routes/safe/components/Settings/SpendingLimit/Modal/index.tsx @@ -0,0 +1,102 @@ +import { Icon, Text, Title } from '@gnosis.pm/safe-react-components' +import React, { ReactElement, ReactNode, ReactNodeArray } from 'react' +import styled from 'styled-components' + +import GnoModal from 'src/components/Modal' +import { useStyles } from 'src/routes/safe/components/Settings/SpendingLimit/style' + +const TitleSection = styled.div` + display: flex; + justify-content: space-between; + padding: 16px 24px; + border-bottom: 2px solid ${({ theme }) => theme.colors.separator}; +` + +const StyledButton = styled.button` + background: none; + border: none; + padding: 5px; + width: 26px; + height: 26px; + + span { + margin-right: 0; + } + + :hover { + background: ${({ theme }) => theme.colors.separator}; + border-radius: 16px; + cursor: pointer; + } +` + +const FooterSection = styled.div` + border-top: 2px solid ${({ theme }) => theme.colors.separator}; + padding: 16px 24px; +` + +const FooterWrapper = styled.div` + display: flex; + justify-content: space-around; +` + +export interface TopBarProps { + title: string + titleNote?: string + onClose: () => void +} + +const TopBar = ({ title, titleNote, onClose }: TopBarProps): ReactElement => ( + + + {title} + {titleNote && ( + <> + {' '} + <Text size="lg" color="secondaryLight" as="span"> + {titleNote} + </Text> + </> + )} + + + + + + +) + +interface FooterProps { + children: ReactNodeArray +} + +const Footer = ({ children }: FooterProps): ReactElement => ( + + {children} + +) + +export interface ModalProps { + children: ReactNode + description: string + handleClose: () => void + open: boolean + title: string +} + +// TODO: this is a potential proposal for `safe-react-components` Modal +// By being able to combine components for better flexibility, this way Buttons can be part of the form body +const Modal = ({ children, ...props }: ModalProps): ReactElement => { + const classes = useStyles() + + return ( + + {children} + + ) +} + +Modal.TopBar = TopBar +Modal.Footer = Footer + +export default Modal diff --git a/src/routes/safe/components/Settings/SpendingLimit/NewLimitModal/Create.tsx b/src/routes/safe/components/Settings/SpendingLimit/NewLimitModal/Create.tsx new file mode 100644 index 00000000..2c048203 --- /dev/null +++ b/src/routes/safe/components/Settings/SpendingLimit/NewLimitModal/Create.tsx @@ -0,0 +1,96 @@ +import { Button } from '@gnosis.pm/safe-react-components' +import { FormState, Mutator } from 'final-form' +import React, { ReactElement } from 'react' +import styled from 'styled-components' + +import GnoForm from 'src/components/forms/GnoForm' +import GnoButton from 'src/components/layout/Button' +import { Amount, Beneficiary, ResetTime, Token } from 'src/routes/safe/components/Settings/SpendingLimit/FormFields' +import Modal from 'src/routes/safe/components/Settings/SpendingLimit/Modal' + +const FormContainer = styled.div` + padding: 24px 8px 24px 24px; + align-items: center; + display: grid; + grid-template-columns: 4fr 1fr; + grid-template-rows: 6fr; + gap: 16px 8px; + grid-template-areas: + 'beneficiaryInput beneficiaryScan' + 'tokenInput .' + 'amountInput .' + 'resetTimeLabel resetTimeLabel' + 'resetTimeToggle resetTimeToggle' + 'resetTimeOption resetTimeOption'; +` + +const YetAnotherButton = styled(GnoButton)` + &.Mui-disabled { + background-color: ${({ theme }) => theme.colors.primary}; + color: ${({ theme }) => theme.colors.white}; + opacity: 0.5; + } +` + +const formMutators: Record> = { + setBeneficiary: (args, state, utils) => { + utils.changeValue(state, 'beneficiary', () => args[0]) + }, +} + +interface NewSpendingLimitProps { + initialValues?: Record + onCancel: () => void + onReview: (values) => void +} + +const canReview = ({ + invalid, + submitting, + dirtyFieldsSinceLastSubmit, + values: { beneficiary, token, amount }, +}: FormState<{ beneficiary: string; token: string; amount: string }>): boolean => + !(submitting || invalid || !beneficiary || !token || !amount || !dirtyFieldsSinceLastSubmit) + +const Create = ({ initialValues, onCancel, onReview }: NewSpendingLimitProps): ReactElement => { + return ( + <> + + + + {(...args) => { + return ( + <> + + + + + + + + + + + {/* TODO: replace this with safe-react-components button. */} + {/* This is used as "submit" SRC Button does not triggers submission up until the 2nd click */} + + Review + + + + ) + }} + + + ) +} + +export default Create diff --git a/src/routes/safe/components/Settings/SpendingLimit/NewLimitModal/Review.tsx b/src/routes/safe/components/Settings/SpendingLimit/NewLimitModal/Review.tsx new file mode 100644 index 00000000..a464f83e --- /dev/null +++ b/src/routes/safe/components/Settings/SpendingLimit/NewLimitModal/Review.tsx @@ -0,0 +1,189 @@ +import { Button, Text } from '@gnosis.pm/safe-react-components' +import React, { ReactElement, useMemo } from 'react' +import { useDispatch, useSelector } from 'react-redux' + +import Block from 'src/components/layout/Block' +import Col from 'src/components/layout/Col' +import Row from 'src/components/layout/Row' +import { getNetworkInfo } from 'src/config' +import createTransaction from 'src/logic/safe/store/actions/createTransaction' +import { SafeRecordProps, SpendingLimit } from 'src/logic/safe/store/models/safe' +import { + addSpendingLimitBeneficiaryMultiSendTx, + currentMinutes, + enableSpendingLimitModuleMultiSendTx, + setSpendingLimitMultiSendTx, + setSpendingLimitTx, + spendingLimitMultiSendTx, + SpendingLimitRow, +} from 'src/logic/safe/utils/spendingLimits' +import { MultiSendTx } from 'src/logic/safe/utils/upgradeSafe' +import { makeToken, Token } from 'src/logic/tokens/store/model/token' +import { fromTokenUnit, toTokenUnit } from 'src/logic/tokens/utils/humanReadableValue' +import { sameAddress, ZERO_ADDRESS } from 'src/logic/wallets/ethAddresses' +import { RESET_TIME_OPTIONS } from 'src/routes/safe/components/Settings/SpendingLimit/FormFields/ResetTime' +import { AddressInfo, ResetTimeInfo, TokenInfo } from 'src/routes/safe/components/Settings/SpendingLimit/InfoDisplay' +import Modal from 'src/routes/safe/components/Settings/SpendingLimit/Modal' +import { useStyles } from 'src/routes/safe/components/Settings/SpendingLimit/style' +import { safeParamAddressFromStateSelector, safeSpendingLimitsSelector } from 'src/logic/safe/store/selectors' + +import { ActionCallback, CREATE } from '.' + +const { nativeCoin } = getNetworkInfo() + +const useExistentSpendingLimit = ({ + spendingLimits, + txToken, + values, +}: { + spendingLimits?: SafeRecordProps['spendingLimits'] + txToken: Token + values: ReviewSpendingLimitProps['values'] +}) => { + // undefined: before setting a value + // null: if no previous value + // SpendingLimit: if previous value exists + return useMemo(() => { + // if `delegate` already exist, check what tokens were delegated to the _beneficiary_ `getTokens(safe, delegate)` + const currentDelegate = spendingLimits?.find( + ({ delegate, token }) => + sameAddress(delegate, values.beneficiary) && + sameAddress(token, sameAddress(values.token, nativeCoin.address) ? ZERO_ADDRESS : values.token), + ) + + // let the user know that is about to replace an existent allowance + if (currentDelegate !== undefined) { + return { + ...currentDelegate, + amount: fromTokenUnit(currentDelegate.amount, txToken.decimals), + } + } else { + return null + } + }, [spendingLimits, txToken.decimals, values.beneficiary, values.token]) +} + +interface ReviewSpendingLimitProps { + onBack: ActionCallback + onClose: () => void + txToken: Token + values: Record + existentSpendingLimit?: SpendingLimitRow +} + +const Review = ({ onBack, onClose, txToken, values }: ReviewSpendingLimitProps): ReactElement => { + const classes = useStyles() + + const dispatch = useDispatch() + + const safeAddress = useSelector(safeParamAddressFromStateSelector) + const spendingLimits = useSelector(safeSpendingLimitsSelector) + const existentSpendingLimit = useExistentSpendingLimit({ spendingLimits, txToken, values }) + + const handleSubmit = () => { + const isSpendingLimitEnabled = spendingLimits !== null + const transactions: MultiSendTx[] = [] + + // is spendingLimit module enabled? -> if not, create the tx to enable it, and encode it + if (!isSpendingLimitEnabled && safeAddress) { + transactions.push(enableSpendingLimitModuleMultiSendTx(safeAddress)) + } + + // does `delegate` already exist? (`getDelegates`, previously queried to build the table with allowances (??)) + // ^ - shall we rely on this or query the list of delegates once again? + const isDelegateAlreadyAdded = + spendingLimits?.some(({ delegate }) => sameAddress(delegate, values?.beneficiary)) ?? false + + // if `delegate` does not exist, add it by calling `addDelegate(beneficiary)` + if (!isDelegateAlreadyAdded && values?.beneficiary) { + transactions.push(addSpendingLimitBeneficiaryMultiSendTx(values.beneficiary)) + } + + // prepare the setAllowance tx + const startTime = currentMinutes() - 30 + const spendingLimitArgs = { + beneficiary: values.beneficiary, + token: values.token, + spendingLimitInWei: toTokenUnit(values.amount, txToken.decimals), + resetTimeMin: values.withResetTime ? +values.resetTime * 60 * 24 : 0, + resetBaseMin: values.withResetTime ? startTime : 0, + } + + if (safeAddress) { + // if there's no tx for enable module or adding a delegate, then we avoid using multiSend Tx + if (transactions.length === 0) { + dispatch(createTransaction(setSpendingLimitTx({ spendingLimitArgs, safeAddress }))) + } else { + transactions.push(setSpendingLimitMultiSendTx({ spendingLimitArgs, safeAddress })) + dispatch(createTransaction(spendingLimitMultiSendTx({ transactions, safeAddress }))) + } + } + } + + const resetTimeLabel = useMemo( + () => (values.withResetTime ? RESET_TIME_OPTIONS.find(({ value }) => value === values.resetTime)?.label : ''), + [values.resetTime, values.withResetTime], + ) + + const previousResetTime = (existentSpendingLimit: SpendingLimit) => + RESET_TIME_OPTIONS.find(({ value }) => value === (+existentSpendingLimit.resetTimeMin / 60 / 24).toString()) + ?.label ?? 'One-time spending limit' + + return ( + <> + + + + + + + + + {existentSpendingLimit && ( + + Previous Amount: {existentSpendingLimit.amount} + + )} + + + + {existentSpendingLimit && ( + + + Previous Reset Time: {previousResetTime(existentSpendingLimit)} + + + )} + + + {existentSpendingLimit && ( + + You are about to replace an existent spending limit + + )} + + + + + + + + + ) +} + +export default Review diff --git a/src/routes/safe/components/Settings/SpendingLimit/NewLimitModal/index.tsx b/src/routes/safe/components/Settings/SpendingLimit/NewLimitModal/index.tsx new file mode 100644 index 00000000..29e7a60f --- /dev/null +++ b/src/routes/safe/components/Settings/SpendingLimit/NewLimitModal/index.tsx @@ -0,0 +1,106 @@ +import { List } from 'immutable' +import React, { ReactElement, Reducer, useCallback, useReducer } from 'react' +import { useSelector } from 'react-redux' + +import { makeToken, Token } from 'src/logic/tokens/store/model/token' +import { sameAddress } from 'src/logic/wallets/ethAddresses' +import { extendedSafeTokensSelector } from 'src/routes/safe/container/selector' +import Modal from 'src/routes/safe/components/Settings/SpendingLimit/Modal' + +import Create from './Create' +import Review from './Review' + +export const CREATE = 'CREATE' as const +export const REVIEW = 'REVIEW' as const + +type Step = typeof CREATE | typeof REVIEW + +type State = { + step: Step + values: Record + txToken: Token +} + +type Action = { + type: Step + newState: State + tokens: List +} + +const newLimitModalReducer = (state: State, action: Action): State => { + const { type, newState, tokens } = action + + switch (type) { + case CREATE: { + return { + ...state, + step: CREATE, + } + } + + case REVIEW: { + return { + ...state, + ...newState, + // we lookup into the list of tokens for the selected token info + txToken: tokens.find((token) => sameAddress(token.address, newState.values.token)) ?? state.txToken, + step: REVIEW, + } + } + } +} + +export type ActionCallback = (state: State) => void +type NewLimitModalHook = [State, { create: ActionCallback; review: ActionCallback }] + +const useNewLimitModal = (initialStep: Step): NewLimitModalHook => { + // globally stored tokens + const tokens = useSelector(extendedSafeTokensSelector) + + // setup the reducer with initial values + const [state, dispatch] = useReducer, State>( + newLimitModalReducer, + { + step: initialStep, + txToken: makeToken(), + values: {}, + }, + (state) => state, + ) + + // define actions + const create = useCallback((newState) => dispatch({ type: CREATE, newState, tokens }), [tokens]) + const review = useCallback((newState) => dispatch({ type: REVIEW, newState, tokens }), [tokens]) + + // returns state and dispatch + return [state, { create, review }] +} + +interface SpendingLimitModalProps { + close: () => void + open: boolean +} + +const NewLimitModal = ({ close, open }: SpendingLimitModalProps): ReactElement => { + // state and dispatch + const [{ step, txToken, values }, { create, review }] = useNewLimitModal(CREATE) + + const handleReview = async (values) => { + // if form is valid, we update the state to REVIEW and sets values + review({ step, txToken, values }) + } + + return ( + + {step === CREATE && } + {step === REVIEW && } + + ) +} + +export default NewLimitModal diff --git a/src/routes/safe/components/Settings/SpendingLimit/NewLimitSteps.tsx b/src/routes/safe/components/Settings/SpendingLimit/NewLimitSteps.tsx new file mode 100644 index 00000000..765a8e0b --- /dev/null +++ b/src/routes/safe/components/Settings/SpendingLimit/NewLimitSteps.tsx @@ -0,0 +1,79 @@ +import { Text } from '@gnosis.pm/safe-react-components' +import React, { ReactElement } from 'react' +import styled from 'styled-components' + +import Img from 'src/components/layout/Img' +import AssetAmount from './assets/asset-amount.svg' +import Beneficiary from './assets/beneficiary.svg' +import Time from './assets/time.svg' + +const StepWrapper = styled.div` + display: flex; + justify-content: space-around; + margin-top: 20px; + max-width: 720px; + text-align: center; +` + +const Step = styled.div` + width: 24%; + min-width: 120px; + max-width: 164px; +` + +const StepsLine = styled.div` + height: 2px; + flex: 1; + background: #d4d5d3; + margin: 46px 0; +` + +const NewLimitSteps = (): ReactElement => ( + + + Select Beneficiary + + + Select Beneficiary + + + + Choose an account that will benefit from this allowance. + + + + The beneficiary does not have to be an owner of this Safe + + + + + + + Select asset and amount + + + Select asset and amount + + + + You can set a spending limit for any asset stored in your Safe + + + + + + + Select time + + + Select time + + + + You can choose to set a one-time spending limit or to have it automatically refill after a defined time-period + + + +) + +export default NewLimitSteps diff --git a/src/routes/safe/components/Settings/SpendingLimit/RemoveLimitModal.tsx b/src/routes/safe/components/Settings/SpendingLimit/RemoveLimitModal.tsx new file mode 100644 index 00000000..c6b89200 --- /dev/null +++ b/src/routes/safe/components/Settings/SpendingLimit/RemoveLimitModal.tsx @@ -0,0 +1,102 @@ +import { Button } from '@gnosis.pm/safe-react-components' +import React, { ReactElement } from 'react' +import { useDispatch, useSelector } from 'react-redux' + +import Block from 'src/components/layout/Block' +import Col from 'src/components/layout/Col' +import useTokenInfo from 'src/logic/safe/hooks/useTokenInfo' +import createTransaction from 'src/logic/safe/store/actions/createTransaction' +import { safeParamAddressFromStateSelector } from 'src/logic/safe/store/selectors' +import { TX_NOTIFICATION_TYPES } from 'src/logic/safe/transactions' +import { getDeleteAllowanceTxData } from 'src/logic/safe/utils/spendingLimits' +import { fromTokenUnit } from 'src/logic/tokens/utils/humanReadableValue' +import { SPENDING_LIMIT_MODULE_ADDRESS } from 'src/utils/constants' + +import { RESET_TIME_OPTIONS } from './FormFields/ResetTime' +import { AddressInfo, ResetTimeInfo, TokenInfo } from './InfoDisplay' +import { SpendingLimitTable } from './LimitsTable/dataFetcher' +import Modal from './Modal' +import { useStyles } from './style' + +interface RemoveSpendingLimitModalProps { + onClose: () => void + spendingLimit: SpendingLimitTable + open: boolean +} + +const RemoveLimitModal = ({ onClose, spendingLimit, open }: RemoveSpendingLimitModalProps): ReactElement => { + const classes = useStyles() + + const tokenInfo = useTokenInfo(spendingLimit.spent.tokenAddress) + + const safeAddress = useSelector(safeParamAddressFromStateSelector) + const dispatch = useDispatch() + + const removeSelectedSpendingLimit = async (): Promise => { + try { + const { + beneficiary, + spent: { tokenAddress }, + } = spendingLimit + const txData = getDeleteAllowanceTxData({ beneficiary, tokenAddress }) + + dispatch( + createTransaction({ + safeAddress, + to: SPENDING_LIMIT_MODULE_ADDRESS, + valueInWei: '0', + txData, + notifiedTransaction: TX_NOTIFICATION_TYPES.REMOVE_SPENDING_LIMIT_TX, + }), + ) + } catch (e) { + console.error( + `failed to remove spending limit ${spendingLimit.beneficiary} -> ${spendingLimit.spent.tokenAddress}`, + e.message, + ) + } + } + + const resetTimeLabel = + RESET_TIME_OPTIONS.find(({ value }) => +value === +spendingLimit.resetTime.resetTimeMin / 24 / 60)?.label ?? '' + + return ( + + + + + + + + + {tokenInfo && ( + + )} + + + + + + + + + + + + ) +} + +export default RemoveLimitModal diff --git a/src/routes/safe/components/Settings/SpendingLimit/assets/asset-amount.svg b/src/routes/safe/components/Settings/SpendingLimit/assets/asset-amount.svg new file mode 100644 index 00000000..afe91aa3 --- /dev/null +++ b/src/routes/safe/components/Settings/SpendingLimit/assets/asset-amount.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/routes/safe/components/Settings/SpendingLimit/assets/beneficiary.svg b/src/routes/safe/components/Settings/SpendingLimit/assets/beneficiary.svg new file mode 100644 index 00000000..f76cf050 --- /dev/null +++ b/src/routes/safe/components/Settings/SpendingLimit/assets/beneficiary.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/src/routes/safe/components/Settings/SpendingLimit/assets/time.svg b/src/routes/safe/components/Settings/SpendingLimit/assets/time.svg new file mode 100644 index 00000000..29a49f6f --- /dev/null +++ b/src/routes/safe/components/Settings/SpendingLimit/assets/time.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/routes/safe/components/Settings/SpendingLimit/index.tsx b/src/routes/safe/components/Settings/SpendingLimit/index.tsx new file mode 100644 index 00000000..fe34b6f9 --- /dev/null +++ b/src/routes/safe/components/Settings/SpendingLimit/index.tsx @@ -0,0 +1,72 @@ +import { Button, Text, Title } from '@gnosis.pm/safe-react-components' +import React, { ReactElement, useState } from 'react' +import { useSelector } from 'react-redux' +import styled from 'styled-components' + +import Block from 'src/components/layout/Block' +import Col from 'src/components/layout/Col' +import Row from 'src/components/layout/Row' +import { safeSpendingLimitsSelector } from 'src/logic/safe/store/selectors' +import { grantedSelector } from 'src/routes/safe/container/selector' + +import LimitsTable from './LimitsTable' +import { getSpendingLimitData } from './LimitsTable/dataFetcher' +import NewLimitModal from './NewLimitModal' +import NewLimitSteps from './NewLimitSteps' +import { useStyles } from './style' + +const InfoText = styled(Text)` + margin-top: 16px; +` + +const SpendingLimitSettings = (): ReactElement => { + const classes = useStyles() + const granted = useSelector(grantedSelector) + const allowances = useSelector(safeSpendingLimitsSelector) + const spendingLimitData = getSpendingLimitData(allowances) + + const [showNewSpendingLimitModal, setShowNewSpendingLimitModal] = useState(false) + const openNewSpendingLimitModal = () => { + setShowNewSpendingLimitModal(true) + } + const closeNewSpendingLimitModal = () => { + setShowNewSpendingLimitModal(false) + } + + return ( + <> + + + Spending Limit + + + You can set rules for specific beneficiaries to access funds from this Safe without having to collect all + signatures. + + {spendingLimitData?.length ? : } + + + {granted && ( + <> + + + + + + {showNewSpendingLimitModal && } + + )} + + ) +} + +export default SpendingLimitSettings diff --git a/src/routes/safe/components/Settings/SpendingLimit/style.ts b/src/routes/safe/components/Settings/SpendingLimit/style.ts new file mode 100644 index 00000000..35b2f9c2 --- /dev/null +++ b/src/routes/safe/components/Settings/SpendingLimit/style.ts @@ -0,0 +1,132 @@ +import { createStyles, makeStyles } from '@material-ui/core' +import { + background, + boldFont, + border, + error, + fontColor, + lg, + md, + secondaryText, + sm, + smallFontSize, + xl, +} from 'src/theme/variables' + +export const useStyles = makeStyles( + createStyles({ + title: { + padding: lg, + paddingBottom: 0, + }, + hide: { + '&:hover': { + backgroundColor: '#fff3e2', + }, + '&:hover $actions': { + visibility: 'initial', + }, + }, + actions: { + justifyContent: 'flex-end', + visibility: 'hidden', + }, + noBorderBottom: { + '& > td': { + borderBottom: 'none', + }, + }, + annotation: { + paddingLeft: lg, + }, + ownersText: { + color: secondaryText, + '& b': { + color: fontColor, + }, + }, + container: { + padding: lg, + }, + actionButton: { + fontWeight: boldFont, + marginRight: sm, + }, + buttonRow: { + padding: lg, + position: 'absolute', + left: 0, + bottom: 0, + boxSizing: 'border-box', + width: '100%', + justifyContent: 'flex-end', + borderTop: `2px solid ${border}`, + }, + modifyBtn: { + height: xl, + fontSize: smallFontSize, + }, + removeModuleIcon: { + marginLeft: lg, + cursor: 'pointer', + }, + modalHeading: { + boxSizing: 'border-box', + justifyContent: 'space-between', + maxHeight: '75px', + padding: `${sm} ${lg}`, + }, + modalContainer: { + minHeight: '369px', + }, + modalManage: { + fontSize: lg, + }, + modalClose: { + height: '35px', + width: '35px', + }, + modalButtonRow: { + height: '84px', + justifyContent: 'center', + }, + modalButtonRemove: { + color: '#fff', + backgroundColor: error, + height: '42px', + }, + modalName: { + textOverflow: 'ellipsis', + overflow: 'hidden', + }, + modalUserName: { + whiteSpace: 'nowrap', + }, + modalOwner: { + backgroundColor: background, + padding: md, + alignItems: 'center', + }, + modalUser: { + justifyContent: 'left', + }, + modalDescription: { + padding: md, + }, + modalOpen: { + paddingLeft: sm, + width: 'auto', + '&:hover': { + cursor: 'pointer', + }, + }, + modal: { + height: 'auto', + maxWidth: 'calc(100% - 30px)', + overflow: 'hidden', + }, + amountInput: { + width: '100% !important', + }, + }), +) diff --git a/src/routes/safe/components/Settings/index.tsx b/src/routes/safe/components/Settings/index.tsx index bf7281aa..70a258fe 100644 --- a/src/routes/safe/components/Settings/index.tsx +++ b/src/routes/safe/components/Settings/index.tsx @@ -7,6 +7,7 @@ import { useState } from 'react' import { useSelector } from 'react-redux' import Advanced from './Advanced' +import SpendingLimitSettings from './SpendingLimit' import ManageOwners from './ManageOwners' import { RemoveSafeModal } from './RemoveSafeModal' import SafeDetails from './SafeDetails' @@ -118,12 +119,22 @@ const Settings: React.FC = () => { + + + + @@ -134,7 +145,8 @@ const Settings: React.FC = () => { {menuOptionIndex === 1 && } {menuOptionIndex === 2 && } {menuOptionIndex === 3 && } - {menuOptionIndex === 4 && } + {menuOptionIndex === 4 && } + {menuOptionIndex === 5 && } diff --git a/src/routes/safe/components/Transactions/TxsTable/ExpandedTx/OwnersColumn/index.tsx b/src/routes/safe/components/Transactions/TxsTable/ExpandedTx/OwnersColumn/index.tsx index 5fbf1262..35ae624f 100644 --- a/src/routes/safe/components/Transactions/TxsTable/ExpandedTx/OwnersColumn/index.tsx +++ b/src/routes/safe/components/Transactions/TxsTable/ExpandedTx/OwnersColumn/index.tsx @@ -91,7 +91,7 @@ const useStyles = makeStyles(styles) type ownersColumnProps = { tx: Transaction - cancelTx: Transaction + cancelTx?: Transaction thresholdReached: boolean cancelThresholdReached: boolean onTxConfirm: () => void diff --git a/src/routes/safe/components/Transactions/TxsTable/ExpandedTx/TxDescription/CustomDescription.tsx b/src/routes/safe/components/Transactions/TxsTable/ExpandedTx/TxDescription/CustomDescription.tsx index cf73ed8f..09cc90c1 100644 --- a/src/routes/safe/components/Transactions/TxsTable/ExpandedTx/TxDescription/CustomDescription.tsx +++ b/src/routes/safe/components/Transactions/TxsTable/ExpandedTx/TxDescription/CustomDescription.tsx @@ -7,6 +7,10 @@ import styled from 'styled-components' import { styles } from './styles' import Value from './Value' +import Col from 'src/components/layout/Col' +import { RESET_TIME_OPTIONS } from 'src/routes/safe/components/Settings/SpendingLimit/FormFields/ResetTime' +import useTokenInfo from 'src/logic/safe/hooks/useTokenInfo' +import { AddressInfo, ResetTimeInfo, TokenInfo } from 'src/routes/safe/components/Settings/SpendingLimit/InfoDisplay' import Block from 'src/components/layout/Block' import { extractMultiSendDataDecoded, @@ -20,12 +24,13 @@ import { getNameFromAddressBookSelector } from 'src/logic/addressBook/store/sele import Paragraph from 'src/components/layout/Paragraph' import LinkWithRef from 'src/components/layout/Link' import { shortVersionOf } from 'src/logic/wallets/ethAddresses' -import { Transaction } from 'src/logic/safe/store/models/types/transaction' -import { DataDecoded } from 'src/routes/safe/store/models/types/transactions.d' +import { Transaction, SafeModuleTransaction } from 'src/logic/safe/store/models/types/transaction' +import { DataDecoded } from 'src/logic/safe/store/models/types/transactions.d' import DividerLine from 'src/components/DividerLine' import { isArrayParameter } from 'src/routes/safe/components/Balances/SendModal/screens/ContractInteraction/utils' import { getExplorerInfo, getNetworkInfo } from 'src/config' +import { decodeMethods, isDeleteAllowanceMethod, isSetAllowanceMethod } from 'src/logic/contracts/methodIds' export const TRANSACTIONS_DESC_CUSTOM_VALUE_TEST_ID = 'tx-description-custom-value' export const TRANSACTIONS_DESC_CUSTOM_DATA_TEST_ID = 'tx-description-custom-data' @@ -47,6 +52,7 @@ const TxDetailsMethodParam = styled.div<{ isArrayParameter: boolean }>` ` const TxDetailsContent = styled.div` padding: 8px 8px 8px 16px; + overflow-wrap: break-word; ` const TxInfo = styled.div` @@ -76,26 +82,103 @@ const TxInfoDetails = ({ data }: { data: DataDecoded }): React.ReactElement => ( ) +const SpendingLimitDetailsContainer = styled.div` + padding-left: 24px; +` + +const spendingLimitTxType = (data: string | null): { isSetSpendingLimit: boolean; isDeleteSpendingLimit: boolean } => ({ + isSetSpendingLimit: !!data && isSetAllowanceMethod(data), + isDeleteSpendingLimit: !!data && isDeleteAllowanceMethod(data), +}) + +interface NewSpendingLimitDetailsProps { + data: DataDecoded +} + +const ModifySpendingLimitDetails = ({ data }: NewSpendingLimitDetailsProps): React.ReactElement => { + const [beneficiary, tokenAddress, amount, resetTimeMin] = React.useMemo( + () => data.parameters.map(({ value }) => value), + [data.parameters], + ) + + const resetTimeLabel = React.useMemo( + () => RESET_TIME_OPTIONS.find(({ value }) => +value === +resetTimeMin / 24 / 60)?.label ?? '', + [resetTimeMin], + ) + + const tokenInfo = useTokenInfo(tokenAddress) + + return ( + <> + + Modify Spending Limit: + + + + + + + {tokenInfo && ( + + )} + + + + + + + ) +} + +const DeleteSpendingLimitDetails = ({ data }: NewSpendingLimitDetailsProps): React.ReactElement => { + const [beneficiary, tokenAddress] = React.useMemo(() => data.parameters.map(({ value }) => value), [data.parameters]) + const tokenInfo = useTokenInfo(tokenAddress) + + return ( + <> + + Delete Spending Limit: + + + + + + {tokenInfo && } + + + ) +} + const MultiSendCustomDataAction = ({ tx, order }: { tx: MultiSendDetails; order: number }): React.ReactElement => { const classes = useStyles() - const methodName = tx.data?.method ? ` (${tx.data.method})` : '' + const methodName = tx.dataDecoded?.method ? ` (${tx.dataDecoded.method})` : '' + const data = tx.dataDecoded ?? decodeMethods(tx.data) const explorerUrl = getExplorerInfo(tx.to) + const { isSetSpendingLimit, isDeleteSpendingLimit } = spendingLimitTxType(tx.data) + return ( } > - - - - Send {fromTokenUnit(tx.value, nativeCoin.decimals)} {nativeCoin.name} to: - - - + {isSetSpendingLimit || isDeleteSpendingLimit ? ( + + {isSetSpendingLimit && } + {isDeleteSpendingLimit && } + + ) : ( + + + + Send {fromTokenUnit(tx.value, nativeCoin.decimals)} {nativeCoin.name} to: + + + - {!!tx.data && } - + {!!data ? : tx.data && } + + )} ) } @@ -173,45 +256,69 @@ const TxActionData = ({ dataDecoded }: { dataDecoded: DataDecoded }): React.Reac ) } -interface GenericCustomDataProps { - amount?: string +interface HexEncodedDataProps { data: string - recipient: string - storedTx: Transaction } -const GenericCustomData = ({ amount = '0', data, recipient, storedTx }: GenericCustomDataProps): React.ReactElement => { +const HexEncodedData = ({ data }: HexEncodedDataProps): React.ReactElement => { const classes = useStyles() - const recipientName = useSelector((state) => getNameFromAddressBookSelector(state, recipient)) - const explorerUrl = getExplorerInfo(recipient) + return ( + + Data (hex encoded): + + + ) +} + +interface GenericCustomDataProps { + amount?: string + data?: string | null + recipient?: string + storedTx: Transaction | SafeModuleTransaction +} + +const GenericCustomData = ({ + amount = '0', + data = null, + recipient, + storedTx, +}: GenericCustomDataProps): React.ReactElement => { + const recipientName = useSelector((state) => getNameFromAddressBookSelector(state, recipient)) + const explorerUrl = recipient ? getExplorerInfo(recipient) : '' + const txData = storedTx?.dataDecoded ?? decodeMethods(data) + const { isSetSpendingLimit, isDeleteSpendingLimit } = spendingLimitTxType(data) + + return isSetSpendingLimit || isDeleteSpendingLimit ? ( + <> + {isSetSpendingLimit && } + {isDeleteSpendingLimit && } + + ) : ( - - Send {amount} to: + {recipient && ( + + Send {amount} to: - - + + + )} - {!!storedTx?.dataDecoded && } - - - Data (hex encoded): - - + {!!txData ? : data && } ) } interface CustomDescriptionProps { amount?: string - data: string - recipient: string + data?: string | null + recipient?: string storedTx: Transaction } diff --git a/src/routes/safe/components/Transactions/TxsTable/ExpandedTx/TxDescription/SettingsDescription.tsx b/src/routes/safe/components/Transactions/TxsTable/ExpandedTx/TxDescription/SettingsDescription.tsx index 43661075..9c2b70a2 100644 --- a/src/routes/safe/components/Transactions/TxsTable/ExpandedTx/TxDescription/SettingsDescription.tsx +++ b/src/routes/safe/components/Transactions/TxsTable/ExpandedTx/TxDescription/SettingsDescription.tsx @@ -1,4 +1,4 @@ -import React from 'react' +import React, { ReactElement } from 'react' import { useSelector } from 'react-redux' import { EtherscanLink } from 'src/components/EtherscanLink' import Block from 'src/components/layout/Block' @@ -20,7 +20,7 @@ interface RemovedOwnerProps { removedOwner: string } -const RemovedOwner = ({ removedOwner }: RemovedOwnerProps): React.ReactElement => { +const RemovedOwner = ({ removedOwner }: RemovedOwnerProps): ReactElement => { const ownerChangedName = useSelector((state) => getNameFromAddressBookSelector(state, removedOwner)) return ( @@ -39,7 +39,7 @@ interface AddedOwnerProps { addedOwner: string } -const AddedOwner = ({ addedOwner }: AddedOwnerProps): React.ReactElement => { +const AddedOwner = ({ addedOwner }: AddedOwnerProps): ReactElement => { const ownerChangedName = useSelector((state) => getNameFromAddressBookSelector(state, addedOwner)) return ( @@ -58,7 +58,7 @@ interface NewThresholdProps { newThreshold: string } -const NewThreshold = ({ newThreshold }: NewThresholdProps): React.ReactElement => ( +const NewThreshold = ({ newThreshold }: NewThresholdProps): ReactElement => ( Change required confirmations: @@ -71,7 +71,7 @@ interface AddModuleProps { module: string } -const AddModule = ({ module }: AddModuleProps): React.ReactElement => ( +const AddModule = ({ module }: AddModuleProps): ReactElement => ( Add module: @@ -82,7 +82,7 @@ interface RemoveModuleProps { module: string } -const RemoveModule = ({ module }: RemoveModuleProps): React.ReactElement => ( +const RemoveModule = ({ module }: RemoveModuleProps): ReactElement => ( Remove module: @@ -90,7 +90,7 @@ const RemoveModule = ({ module }: RemoveModuleProps): React.ReactElement => ( ) interface SettingsDescriptionProps { - action: SafeMethods + action?: SafeMethods addedOwner?: string newThreshold?: string removedOwner?: string @@ -103,7 +103,7 @@ const SettingsDescription = ({ newThreshold, removedOwner, module, -}: SettingsDescriptionProps): React.ReactElement => { +}: SettingsDescriptionProps): ReactElement => { if (action === SAFE_METHODS_NAMES.REMOVE_OWNER && removedOwner && newThreshold) { return ( <> diff --git a/src/routes/safe/components/Transactions/TxsTable/ExpandedTx/TxDescription/TransferDescription.tsx b/src/routes/safe/components/Transactions/TxsTable/ExpandedTx/TxDescription/TransferDescription.tsx index 2cdbab12..91a324ca 100644 --- a/src/routes/safe/components/Transactions/TxsTable/ExpandedTx/TxDescription/TransferDescription.tsx +++ b/src/routes/safe/components/Transactions/TxsTable/ExpandedTx/TxDescription/TransferDescription.tsx @@ -1,4 +1,4 @@ -import React from 'react' +import React, { ReactElement } from 'react' import { useSelector } from 'react-redux' import { EtherscanLink } from 'src/components/EtherscanLink' import Block from 'src/components/layout/Block' @@ -11,7 +11,7 @@ import SendModal from 'src/routes/safe/components/Balances/SendModal' interface TransferDescriptionProps { amountWithSymbol: string - recipient: string + recipient?: string tokenAddress?: string rawAmount?: string isTokenTransfer: boolean @@ -23,7 +23,7 @@ const TransferDescription = ({ tokenAddress, rawAmount, isTokenTransfer, -}: TransferDescriptionProps): React.ReactElement => { +}: TransferDescriptionProps): ReactElement | null => { const recipientName = useSelector((state) => getNameFromAddressBookSelector(state, recipient)) const [sendModalOpen, setSendModalOpen] = React.useState(false) @@ -31,7 +31,7 @@ const TransferDescription = ({ setSendModalOpen(true) } - return ( + return recipient ? ( <> Send {amountWithSymbol} to: @@ -60,7 +60,7 @@ const TransferDescription = ({ tokenAmount={rawAmount} /> - ) + ) : null } export default TransferDescription diff --git a/src/routes/safe/components/Transactions/TxsTable/ExpandedTx/TxDescription/index.tsx b/src/routes/safe/components/Transactions/TxsTable/ExpandedTx/TxDescription/index.tsx index cf7cd433..24933312 100644 --- a/src/routes/safe/components/Transactions/TxsTable/ExpandedTx/TxDescription/index.tsx +++ b/src/routes/safe/components/Transactions/TxsTable/ExpandedTx/TxDescription/index.tsx @@ -7,59 +7,45 @@ import SettingsDescription from './SettingsDescription' import CustomDescription from './CustomDescription' import TransferDescription from './TransferDescription' -import { getRawTxAmount, getTxAmount } from 'src/routes/safe/components/Transactions/TxsTable/columns' +import { getTxAmount } from 'src/routes/safe/components/Transactions/TxsTable/columns' import Block from 'src/components/layout/Block' -import { Transaction } from 'src/logic/safe/store/models/types/transaction' +import { Transaction, TransactionTypes } from 'src/logic/safe/store/models/types/transaction' export const TRANSACTIONS_DESC_SEND_TEST_ID = 'tx-description-send' const useStyles = makeStyles(styles) +const SettingsDescriptionTx = ({ tx }: { tx: Transaction }): React.ReactElement => { + const { action, addedOwner, module, newThreshold, removedOwner } = getTxData(tx) + return +} + +const CustomDescriptionTx = ({ tx }: { tx: Transaction }): React.ReactElement => { + const amount = getTxAmount(tx, false) + const { data, recipient } = getTxData(tx) + return +} + +const UpgradeDescriptionTx = ({ tx }: { tx: Transaction }): React.ReactElement => { + const { data } = getTxData(tx) + return
{data}
+} + +const TransferDescriptionTx = ({ tx }: { tx: Transaction }): React.ReactElement => { + const amountWithSymbol = getTxAmount(tx, false) + const { recipient, isTokenTransfer = false } = getTxData(tx) + return +} + const TxDescription = ({ tx }: { tx: Transaction }): React.ReactElement => { const classes = useStyles() - const { - action, - addedOwner, - cancellationTx, - creationTx, - customTx, - data, - modifySettingsTx, - module, - newThreshold, - recipient, - removedOwner, - upgradeTx, - tokenAddress, - isTokenTransfer, - }: any = getTxData(tx) - const amountWithSymbol = getTxAmount(tx, false) - const amount = getRawTxAmount(tx) return ( - {modifySettingsTx && action && ( - - )} - {!upgradeTx && customTx && ( - - )} - {upgradeTx &&
{data}
} - {!cancellationTx && !modifySettingsTx && !customTx && !creationTx && !upgradeTx && ( - - )} + {tx.type === TransactionTypes.SETTINGS && } + {tx.type === TransactionTypes.CUSTOM && } + {tx.type === TransactionTypes.UPGRADE && } + {[TransactionTypes.TOKEN, TransactionTypes.COLLECTIBLE].includes(tx.type) && }
) } diff --git a/src/routes/safe/components/Transactions/TxsTable/ExpandedTx/TxDescription/utils.ts b/src/routes/safe/components/Transactions/TxsTable/ExpandedTx/TxDescription/utils.ts index 08d8ec47..5a702409 100644 --- a/src/routes/safe/components/Transactions/TxsTable/ExpandedTx/TxDescription/utils.ts +++ b/src/routes/safe/components/Transactions/TxsTable/ExpandedTx/TxDescription/utils.ts @@ -1,5 +1,5 @@ import { Transaction } from 'src/logic/safe/store/models/types/transaction' -import { SAFE_METHODS_NAMES } from 'src/routes/safe/store/models/types/transactions.d' +import { SAFE_METHODS_NAMES, SafeMethods, TokenDecodedParams } from 'src/logic/safe/store/models/types/transactions.d' import { sameString } from 'src/utils/strings' import { getNetworkInfo } from 'src/config' @@ -17,7 +17,7 @@ interface TxData { data?: string | null recipient?: string module?: string - action?: string + action?: SafeMethods addedOwner?: string removedOwner?: string newThreshold?: string @@ -97,7 +97,7 @@ const getTxDataForTxsWithDecodedParams = (tx: Transaction): TxData => { } if (tx.isTokenTransfer) { - const { to } = tx.decodedParams.transfer || {} + const { to } = (tx.decodedParams as TokenDecodedParams).transfer || {} txData.recipient = to txData.isTokenTransfer = true txData.tokenAddress = tx.recipient @@ -105,7 +105,7 @@ const getTxDataForTxsWithDecodedParams = (tx: Transaction): TxData => { } if (tx.isCollectibleTransfer) { - const { safeTransferFrom, transfer, transferFrom } = tx.decodedParams + const { safeTransferFrom, transfer, transferFrom } = tx.decodedParams as TokenDecodedParams const { to, value } = safeTransferFrom || transferFrom || transfer || {} txData.recipient = to txData.tokenId = value diff --git a/src/routes/safe/components/Transactions/TxsTable/ExpandedTx/index.tsx b/src/routes/safe/components/Transactions/TxsTable/ExpandedTx/index.tsx index 728f05ce..22e8de7e 100644 --- a/src/routes/safe/components/Transactions/TxsTable/ExpandedTx/index.tsx +++ b/src/routes/safe/components/Transactions/TxsTable/ExpandedTx/index.tsx @@ -1,6 +1,5 @@ -import { makeStyles } from '@material-ui/core/styles' import cn from 'classnames' -import React, { useState } from 'react' +import React, { ReactElement, useMemo, useState } from 'react' import { useSelector } from 'react-redux' import { EthHashInfo } from '@gnosis.pm/safe-react-components' @@ -11,8 +10,15 @@ import TxDescription from './TxDescription' import { IncomingTx } from './IncomingTx' import { CreationTx } from './CreationTx' import { OutgoingTx } from './OutgoingTx' -import { styles } from './style' +import useStyles from './style' +import { + getModuleAmount, + NOT_AVAILABLE, + TableData, + TX_TABLE_RAW_CANCEL_TX_ID, + TX_TABLE_RAW_TX_ID, +} from 'src/routes/safe/components/Transactions/TxsTable/columns' import Block from 'src/components/layout/Block' import Bold from 'src/components/layout/Bold' import Col from 'src/components/layout/Col' @@ -22,21 +28,73 @@ import Row from 'src/components/layout/Row' import Span from 'src/components/layout/Span' import { getWeb3 } from 'src/logic/wallets/getWeb3' import { INCOMING_TX_TYPES } from 'src/logic/safe/store/models/incomingTransaction' -import { safeNonceSelector, safeThresholdSelector } from 'src/logic/safe/store/selectors' -import { Transaction, TransactionTypes } from 'src/logic/safe/store/models/types/transaction' +import { Transaction, TransactionTypes, SafeModuleTransaction } from 'src/logic/safe/store/models/types/transaction' import IncomingTxDescription from './IncomingTxDescription' import { getExplorerInfo, getNetworkInfo } from 'src/config' +import TransferDescription from './TxDescription/TransferDescription' +import { sameAddress } from 'src/logic/wallets/ethAddresses' +import { safeNonceSelector, safeThresholdSelector } from 'src/logic/safe/store/selectors' -const useStyles = makeStyles(styles as any) +const ExpandedModuleTx = ({ tx }: { tx: SafeModuleTransaction }): ReactElement => { + const classes = useStyles() -interface ExpandedTxProps { - cancelTx: Transaction + const recipient = useMemo(() => { + if (tx.type === TransactionTypes.SPENDING_LIMIT) { + if (tx.dataDecoded) { + // if `dataDecoded` is defined, then it's a token transfer + return tx.dataDecoded?.parameters[0].value + } else { + // if `data` is not defined, then it's an ETH transfer + return tx.to + } + } + }, [tx.dataDecoded, tx.to, tx.type]) + + const amountWithSymbol = getModuleAmount(tx) + + return ( + + + + +
+ Hash: + {tx.executionTxHash ? ( + + ) : ( + 'n/a' + )} +
+
+ + + {recipient && ( + + )} + + +
+
+ ) +} + +interface ExpandedSafeTxProps { + cancelTx?: Transaction tx: Transaction } const { nativeCoin } = getNetworkInfo() -const ExpandedTx = ({ cancelTx, tx }: ExpandedTxProps): React.ReactElement => { +const ExpandedSafeTx = ({ cancelTx, tx }: ExpandedSafeTxProps): ReactElement => { const { fromWei, toBN } = getWeb3().utils const classes = useStyles() const nonce = useSelector(safeNonceSelector) @@ -122,7 +180,7 @@ const ExpandedTx = ({ cancelTx, tx }: ExpandedTxProps): React.ReactElement => { /> )} {openModal === 'rejectTx' && } - {openModal === 'executeRejectTx' && ( + {openModal === 'executeRejectTx' && cancelTx && ( { ) } -export default ExpandedTx +export const ExpandedTx = ({ row }: { row: TableData }): ReactElement => { + const isModuleTx = [TransactionTypes.SPENDING_LIMIT, TransactionTypes.MODULE].includes(row.tx.type) + + if (isModuleTx) { + return + } + + return +} diff --git a/src/routes/safe/components/Transactions/TxsTable/ExpandedTx/style.ts b/src/routes/safe/components/Transactions/TxsTable/ExpandedTx/style.ts index d76074be..7e85f743 100644 --- a/src/routes/safe/components/Transactions/TxsTable/ExpandedTx/style.ts +++ b/src/routes/safe/components/Transactions/TxsTable/ExpandedTx/style.ts @@ -1,28 +1,29 @@ +import { createStyles, makeStyles } from '@material-ui/core' import { border, lg, md } from 'src/theme/variables' -const cssStyles = { - col: { - wordBreak: 'break-word', - whiteSpace: 'normal', - }, - expandedTxBlock: { - borderBottom: `2px solid ${border}`, - }, - txDataContainer: { - padding: `${lg} ${md}`, - }, - txHash: { - paddingRight: '3px', - }, - incomingTxBlock: { - borderRight: '2px solid rgb(232, 231, 230)', - }, - emptyRowDataContainer: { - paddingTop: lg, - paddingLeft: md, - paddingBottom: md, - borderRight: '2px solid rgb(232, 231, 230)', - }, -} - -export const styles = (): typeof cssStyles => cssStyles +export default makeStyles( + createStyles({ + col: { + wordBreak: 'break-word', + whiteSpace: 'normal', + }, + expandedTxBlock: { + borderBottom: `2px solid ${border}`, + }, + txDataContainer: { + padding: `${lg} ${md}`, + }, + txHash: { + paddingRight: '3px', + }, + incomingTxBlock: { + borderRight: '2px solid rgb(232, 231, 230)', + }, + emptyRowDataContainer: { + paddingTop: lg, + paddingLeft: md, + paddingBottom: md, + borderRight: '2px solid rgb(232, 231, 230)', + }, + }), +) diff --git a/src/routes/safe/components/Transactions/TxsTable/TxType/index.tsx b/src/routes/safe/components/Transactions/TxsTable/TxType/index.tsx index 28c54f67..bfe52d2e 100644 --- a/src/routes/safe/components/Transactions/TxsTable/TxType/index.tsx +++ b/src/routes/safe/components/Transactions/TxsTable/TxType/index.tsx @@ -20,6 +20,8 @@ const typeToIcon = { creation: SettingsTxIcon, cancellation: SettingsTxIcon, upgrade: SettingsTxIcon, + module: SettingsTxIcon, + spendingLimit: SettingsTxIcon, } const typeToLabel = { @@ -32,6 +34,8 @@ const typeToLabel = { creation: 'Safe created', cancellation: 'Cancellation transaction', upgrade: 'Contract Upgrade', + module: 'Module transaction', + spendingLimit: 'Spending Limit', } interface TxTypeProps { diff --git a/src/routes/safe/components/Transactions/TxsTable/columns.tsx b/src/routes/safe/components/Transactions/TxsTable/columns.tsx index db364e72..713fc32c 100644 --- a/src/routes/safe/components/Transactions/TxsTable/columns.tsx +++ b/src/routes/safe/components/Transactions/TxsTable/columns.tsx @@ -11,7 +11,8 @@ import { buildOrderFieldFrom } from 'src/components/Table/sorting' import { TableColumn } from 'src/components/Table/types.d' import { formatAmount } from 'src/logic/tokens/utils/formatAmount' import { INCOMING_TX_TYPES } from 'src/logic/safe/store/models/incomingTransaction' -import { Transaction } from 'src/logic/safe/store/models/types/transaction' +import { SafeModuleTransaction, Transaction, TransactionTypes } from 'src/logic/safe/store/models/types/transaction' +import { TokenDecodedParams } from 'src/logic/safe/store/models/types/transactions.d' import { CancellationTransactions } from 'src/logic/safe/store/reducer/cancellationTransactions' import { getNetworkInfo } from 'src/config' @@ -26,7 +27,7 @@ export const TX_TABLE_EXPAND_ICON = 'expand' export const formatDate = (date: string): string => format(parseISO(date), 'MMM d, yyyy - HH:mm:ss') -const NOT_AVAILABLE = 'n/a' +export const NOT_AVAILABLE = 'n/a' interface AmountData { decimals?: number | string @@ -59,7 +60,8 @@ export const getIncomingTxAmount = (tx: Transaction, formatted = true): string = export const getTxAmount = (tx: Transaction, formatted = true): string => { const { decimals = 18, decodedParams, isTokenTransfer, symbol } = tx - const { value } = isTokenTransfer && !!decodedParams?.transfer ? decodedParams.transfer : tx + const tokenDecodedTransfer = isTokenTransfer && (decodedParams as TokenDecodedParams)?.transfer + const { value } = tokenDecodedTransfer || tx if (tx.isCollectibleTransfer) { return `1 ${tx.symbol}` @@ -72,10 +74,32 @@ export const getTxAmount = (tx: Transaction, formatted = true): string => { return getAmountWithSymbol({ decimals: decimals as string, symbol: symbol as string, value }, formatted) } +export const getModuleAmount = (tx: SafeModuleTransaction, formatted = true): string => { + if (tx.type === TransactionTypes.SPENDING_LIMIT && tx.tokenInfo) { + const { decimals, symbol } = tx.tokenInfo + + let value + + if (tx.dataDecoded) { + // if `dataDecoded` is defined, then it's a token transfer + const [, amount] = tx.dataDecoded.parameters + value = amount.value + } else { + // if `dataDecoded` is not defined, then it's an ETH transfer + value = tx.value + } + + return getAmountWithSymbol({ decimals, symbol, value }, formatted) + } + + return NOT_AVAILABLE +} + export const getRawTxAmount = (tx: Transaction): string => { const { decimals, decodedParams, isTokenTransfer } = tx const { nativeCoin } = getNetworkInfo() - const { value } = isTokenTransfer && !!decodedParams?.transfer ? decodedParams.transfer : tx + const tokenDecodedTransfer = isTokenTransfer && (decodedParams as TokenDecodedParams)?.transfer + const { value } = tokenDecodedTransfer || tx if (tx.isCollectibleTransfer) { return '1' @@ -98,10 +122,20 @@ export interface TableData { dateOrder?: number id: string status: string - tx?: Transaction + tx: Transaction | SafeModuleTransaction type: any } +const getModuleTxTableData = (tx: SafeModuleTransaction): TableData => ({ + [TX_TABLE_ID]: tx.blockNumber?.toString() ?? '', + [TX_TABLE_TYPE_ID]: , + [TX_TABLE_DATE_ID]: formatDate(tx.executionDate), + [buildOrderFieldFrom(TX_TABLE_DATE_ID)]: getTime(parseISO(tx.executionDate)), + [TX_TABLE_AMOUNT_ID]: getModuleAmount(tx), + [TX_TABLE_STATUS_ID]: tx.status, + [TX_TABLE_RAW_TX_ID]: tx, +}) + const getIncomingTxTableData = (tx: Transaction): TableData => ({ [TX_TABLE_ID]: tx.blockNumber?.toString() ?? '', [TX_TABLE_TYPE_ID]: , @@ -112,12 +146,24 @@ const getIncomingTxTableData = (tx: Transaction): TableData => ({ [TX_TABLE_RAW_TX_ID]: tx, }) +// This follows the approach of calculating the tx information closest to the presentation components. +// Instead of populating tx in the store with another flag, Spending Limit tx is inferred here. +const getTxType = (tx: Transaction): TransactionTypes => { + const SET_ALLOWANCE_HASH = 'beaeb388' + const DELETE_ALLOWANCE_HASH = '885133e3' + + return tx.data?.includes(SET_ALLOWANCE_HASH) || tx.data?.includes(DELETE_ALLOWANCE_HASH) + ? TransactionTypes.SPENDING_LIMIT + : tx.type +} + const getTransactionTableData = (tx: Transaction, cancelTx?: Transaction): TableData => { const txDate = tx.submissionDate + const txType = getTxType(tx) return { [TX_TABLE_ID]: tx.blockNumber?.toString() ?? '', - [TX_TABLE_TYPE_ID]: , + [TX_TABLE_TYPE_ID]: , [TX_TABLE_DATE_ID]: txDate ? formatDate(txDate) : '', [buildOrderFieldFrom(TX_TABLE_DATE_ID)]: txDate ? getTime(parseISO(txDate)) : null, [TX_TABLE_AMOUNT_ID]: getTxAmount(tx), @@ -128,15 +174,22 @@ const getTransactionTableData = (tx: Transaction, cancelTx?: Transaction): Table } export const getTxTableData = ( - transactions: List, + transactions: List, cancelTxs: CancellationTransactions, ): List => { return transactions.map((tx) => { - if (INCOMING_TX_TYPES[tx.type] !== undefined) { - return getIncomingTxTableData(tx) + const isModuleTx = [TransactionTypes.SPENDING_LIMIT, TransactionTypes.MODULE].includes(tx.type) + const isIncomingTx = INCOMING_TX_TYPES[tx.type] !== undefined + + if (isModuleTx) { + return getModuleTxTableData(tx as SafeModuleTransaction) } - return getTransactionTableData(tx, cancelTxs.get(`${tx.nonce}`)) + if (isIncomingTx) { + return getIncomingTxTableData(tx as Transaction) + } + + return getTransactionTableData(tx as Transaction, cancelTxs.get(`${tx.nonce}`)) }) } diff --git a/src/routes/safe/components/Transactions/TxsTable/index.tsx b/src/routes/safe/components/Transactions/TxsTable/index.tsx index 522c277a..9050674b 100644 --- a/src/routes/safe/components/Transactions/TxsTable/index.tsx +++ b/src/routes/safe/components/Transactions/TxsTable/index.tsx @@ -10,9 +10,9 @@ import cn from 'classnames' import React, { useState, useEffect } from 'react' import { useSelector } from 'react-redux' -import ExpandedTxComponent from './ExpandedTx' +import { ExpandedTx } from './ExpandedTx' import Status from './Status' -import { TX_TABLE_ID, TX_TABLE_RAW_CANCEL_TX_ID, TX_TABLE_RAW_TX_ID, generateColumns, getTxTableData } from './columns' +import { TX_TABLE_ID, generateColumns, getTxTableData } from './columns' import { styles } from './style' import Table from 'src/components/Table' @@ -35,8 +35,8 @@ const TxsTable = ({ classes }) => { trackEvent({ category: SAFE_NAVIGATION_EVENT, action: 'Transactions' }) }, [trackEvent]) - const handleTxExpand = (safeTxHash) => { - setExpandedTx((prevTx) => (prevTx === safeTxHash ? null : safeTxHash)) + const handleTxExpand = (rowId) => { + setExpandedTx((prevRowId) => (prevRowId === rowId ? null : rowId)) } const columns = generateColumns() @@ -44,8 +44,8 @@ const TxsTable = ({ classes }) => { const filteredData = getTxTableData(transactions, cancellationTransactions) .sort((tx1, tx2) => { // First order by nonce - const aNonce = tx1.tx?.nonce - const bNonce = tx1.tx?.nonce + const aNonce = Number(tx1.tx?.nonce) + const bNonce = Number(tx1.tx?.nonce) if (aNonce && bNonce) { const difference = aNonce - bNonce if (difference !== 0) { @@ -82,54 +82,56 @@ const TxsTable = ({ classes }) => { size={filteredData.size} > {(sortedData) => - sortedData.map((row, index) => ( - - handleTxExpand(row.tx.safeTxHash)} - tabIndex={-1} - > - {autoColumns.map((column) => ( - - {row[column.id]} - - ))} - - - - - - - - {expandedTx === row.tx.safeTxHash ? : } - - - - - { + const rowId = `${row.tx.safeTxHash}-${row.tx.type}` + return ( + + handleTxExpand(rowId)} + tabIndex={-1} > - ( - - )} - in={expandedTx === row.tx.safeTxHash} - timeout="auto" - unmountOnExit - /> - - - - )) + {autoColumns.map((column) => ( + + {row[column.id]} + + ))} + + + + + + + {expandedTx === rowId ? : } + + + + + } + in={expandedTx === rowId} + timeout="auto" + unmountOnExit + /> + + + + ) + }) } diff --git a/src/routes/safe/container/selector.ts b/src/routes/safe/container/selector.ts index f27581d9..0c8e0a42 100644 --- a/src/routes/safe/container/selector.ts +++ b/src/routes/safe/container/selector.ts @@ -2,13 +2,27 @@ import { List, Map } from 'immutable' import { createSelector } from 'reselect' import { Token } from 'src/logic/tokens/store/model/token' -import { tokensSelector } from 'src/logic/tokens/store/selectors' +import { tokenListSelector, tokensSelector } from 'src/logic/tokens/store/selectors' import { getEthAsToken } from 'src/logic/tokens/utils/tokenHelpers' -import { isUserAnOwner } from 'src/logic/wallets/ethAddresses' +import { isUserAnOwner, sameAddress } from 'src/logic/wallets/ethAddresses' import { userAccountSelector } from 'src/logic/wallets/store/selectors' -import { safeActiveTokensSelector, safeBalancesSelector, safeSelector } from 'src/logic/safe/store/selectors' +import { + safeActiveTokensSelector, + safeBalancesSelector, + safeParamAddressFromStateSelector, + safeSelector, +} from 'src/logic/safe/store/selectors' import { SafeRecord } from 'src/logic/safe/store/models/safe' +import { AppReduxState } from 'src/store' +import { MODULE_TRANSACTIONS_REDUCER_ID } from 'src/logic/safe/store/reducer/moduleTransactions' +import { ModuleTxServiceModel } from 'src/logic/safe/store/actions/transactions/fetchTransactions/loadModuleTransactions' +import { + SafeModuleTransaction, + TransactionStatus, + TransactionTypes, +} from 'src/logic/safe/store/models/types/transaction' +import { SPENDING_LIMIT_MODULE_ADDRESS } from 'src/utils/constants' export const grantedSelector = createSelector( userAccountSelector, @@ -48,3 +62,67 @@ export const extendedSafeTokensSelector = createSelector( return extendedTokens.toList() }, ) + +export const safeKnownCoins = createSelector( + tokensSelector, + safeEthAsTokenSelector, + (safeTokens, nativeCoinAsToken): List => { + if (nativeCoinAsToken) { + return safeTokens.set(nativeCoinAsToken.address, nativeCoinAsToken).toList() + } + + return safeTokens.toList() + }, +) + +const moduleTransactionsSelector = (state: AppReduxState) => state[MODULE_TRANSACTIONS_REDUCER_ID] + +export const modulesTransactionsBySafeSelector = createSelector( + moduleTransactionsSelector, + safeParamAddressFromStateSelector, + (moduleTransactions, safeAddress): ModuleTxServiceModel[] => { + // no module tx for the current safe so far + if (!moduleTransactions || !safeAddress || !moduleTransactions[safeAddress]) { + return [] + } + + return moduleTransactions[safeAddress] + }, +) + +export const safeModuleTransactionsSelector = createSelector( + tokenListSelector, + modulesTransactionsBySafeSelector, + (tokens, safeModuleTransactions): SafeModuleTransaction[] => { + return safeModuleTransactions.map((moduleTx) => { + // if not spendingLimit module tx, then it's an generic module tx + const type = sameAddress(moduleTx.module, SPENDING_LIMIT_MODULE_ADDRESS) + ? TransactionTypes.SPENDING_LIMIT + : TransactionTypes.MODULE + + // TODO: this is strictly attached to Spending Limit Module. + // This has to be moved nearest the module info rendering. + // add token info to the model, so data can be properly displayed in the UI + let tokenInfo + if (type === TransactionTypes.SPENDING_LIMIT) { + if (moduleTx.data) { + // if `data` is defined, then it's a token transfer + tokenInfo = tokens.find(({ address }) => sameAddress(address, moduleTx.to)) + } else { + // if `data` is not defined, then it's an ETH transfer + // ETH does not exist in the list of tokens, so we recreate the record here + tokenInfo = getEthAsToken(0) + } + } + + return { + ...moduleTx, + safeTxHash: moduleTx.transactionHash, + executionTxHash: moduleTx.transactionHash, + status: TransactionStatus.SUCCESS, + tokenInfo, + type, + } + }) + }, +) diff --git a/src/routes/safe/store/actions/transactions/utils/multiSendDecodedDetails.ts b/src/routes/safe/store/actions/transactions/utils/multiSendDecodedDetails.ts index b03c4751..3573c275 100644 --- a/src/routes/safe/store/actions/transactions/utils/multiSendDecodedDetails.ts +++ b/src/routes/safe/store/actions/transactions/utils/multiSendDecodedDetails.ts @@ -19,7 +19,8 @@ import { Transaction } from 'src/logic/safe/store/models/types/transaction' export type MultiSendDetails = { operation: Operation to: string - data: DataDecoded | null + data: string | null + dataDecoded: DataDecoded | null value: number } @@ -48,7 +49,8 @@ export const extractMultiSendDetails = (parameter: Parameter): MultiSendDetails[ operation: valueDecoded.operation, to: valueDecoded.to, value: valueDecoded.value, - data: valueDecoded?.dataDecoded ?? null, + dataDecoded: valueDecoded?.dataDecoded ?? null, + data: valueDecoded?.data ?? null, } }) } diff --git a/src/store/index.ts b/src/store/index.ts index a4095608..857b8819 100644 --- a/src/store/index.ts +++ b/src/store/index.ts @@ -41,6 +41,10 @@ import { NFTAssets, NFTTokens } from 'src/logic/collectibles/sources/collectible import { SafeReducerMap } from 'src/routes/safe/store/reducer/types/safe' import allTransactions, { TRANSACTIONS, TransactionsState } from '../logic/safe/store/reducer/allTransactions' import { AddressBookState } from 'src/logic/addressBook/model/addressBook' +import moduleTransactions, { + MODULE_TRANSACTIONS_REDUCER_ID, + ModuleTransactionsState, +} from 'src/logic/safe/store/reducer/moduleTransactions' export const history = createHashHistory() @@ -68,6 +72,7 @@ const reducers = combineReducers({ [TRANSACTIONS_REDUCER_ID]: transactions, [CANCELLATION_TRANSACTIONS_REDUCER_ID]: cancellationTransactions, [INCOMING_TRANSACTIONS_REDUCER_ID]: incomingTransactions, + [MODULE_TRANSACTIONS_REDUCER_ID]: moduleTransactions, [NOTIFICATIONS_REDUCER_ID]: notifications, [CURRENCY_VALUES_KEY]: currencyValues, [COOKIES_REDUCER_ID]: cookies, @@ -85,6 +90,7 @@ export type AppReduxState = CombinedState<{ [TRANSACTIONS_REDUCER_ID]: Map [CANCELLATION_TRANSACTIONS_REDUCER_ID]: CancellationTxState [INCOMING_TRANSACTIONS_REDUCER_ID]: Map + [MODULE_TRANSACTIONS_REDUCER_ID]: ModuleTransactionsState [NOTIFICATIONS_REDUCER_ID]: Map [CURRENCY_VALUES_KEY]: CurrencyValuesState [COOKIES_REDUCER_ID]: Map diff --git a/src/utils/constants.ts b/src/utils/constants.ts index 0828f8a9..c03e7121 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -26,3 +26,5 @@ export const ETHERSCAN_API_KEY = process.env.REACT_APP_ETHERSCAN_API_KEY export const EXCHANGE_RATE_URL = 'https://api.exchangeratesapi.io/latest' export const EXCHANGE_RATE_URL_FALLBACK = 'https://api.coinbase.com/v2/exchange-rates' export const IPFS_GATEWAY = process.env.REACT_APP_IPFS_GATEWAY +export const SPENDING_LIMIT_MODULE_ADDRESS = + process.env.REACT_APP_SPENDING_LIMIT_MODULE_ADDRESS || '0xCFbFaC74C26F8647cBDb8c5caf80BB5b32E43134' diff --git a/src/utils/date.ts b/src/utils/date.ts new file mode 100644 index 00000000..931759f6 --- /dev/null +++ b/src/utils/date.ts @@ -0,0 +1,13 @@ +import { formatRelative } from 'date-fns' + +export const relativeTime = (baseTimeMin: string, resetTimeMin: string): string => { + if (resetTimeMin === '0') { + return 'One-time' + } + + const baseTimeSeconds = +baseTimeMin * 60 + const resetTimeSeconds = +resetTimeMin * 60 + const nextResetTimeMilliseconds = (baseTimeSeconds + resetTimeSeconds) * 1000 + + return formatRelative(nextResetTimeMilliseconds, Date.now()) +}