diff --git a/.env.example b/.env.example index cb172be891..23a68730e6 100644 --- a/.env.example +++ b/.env.example @@ -30,3 +30,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/src/components/Modal/index.tsx b/src/components/Modal/index.tsx index 9a7f23e916..a758c041e7 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 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: '530px', - 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: '530px', + 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: React.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): React.ReactElement => { + const classes = useStyles() + + return ( + +
{children}
+
+ ) +} -export default withStyles(styles as any)(GnoModal) +export default GnoModal diff --git a/src/components/ScanQRModal/ScanQRWrapper/index.tsx b/src/components/ScanQRModal/ScanQRWrapper/index.tsx index 9982e6c400..e03654e410 100644 --- a/src/components/ScanQRModal/ScanQRWrapper/index.tsx +++ b/src/components/ScanQRModal/ScanQRWrapper/index.tsx @@ -1,20 +1,23 @@ +import { Button, Icon } from '@gnosis.pm/safe-react-components' import { makeStyles } from '@material-ui/core/styles' -import { useState } from 'react' -import * as React from 'react' +import React from 'react' -import QRIcon from 'src/assets/icons/qrcode.svg' import ScanQRModal from 'src/components/ScanQRModal' -import Img from 'src/components/layout/Img' const useStyles = makeStyles({ qrCodeBtn: { - cursor: 'pointer', + padding: '0 !important', + minWidth: '40px', }, }) -export const ScanQRWrapper = (props) => { +interface ScanQRWrapperProps { + handleScan: (value: string, closeQRCallback: () => void) => void +} + +export const ScanQRWrapper = ({ handleScan }: ScanQRWrapperProps): React.ReactElement => { const classes = useStyles() - const [qrModalOpen, setQrModalOpen] = useState(false) + const [qrModalOpen, setQrModalOpen] = React.useState(false) const openQrModal = () => { setQrModalOpen(true) @@ -25,22 +28,21 @@ export const ScanQRWrapper = (props) => { } const onScanFinished = (value) => { - props.handleScan(value, closeQrModal) + handleScan(value, closeQrModal) } return ( <> - Scan QR { - openQrModal() - }} - role="button" - src={QRIcon} - testId="qr-icon" - /> + > + + {qrModalOpen && } ) diff --git a/src/logic/contracts/artifacts/AllowanceModule.json b/src/logic/contracts/artifacts/AllowanceModule.json new file mode 100644 index 0000000000..5145062965 --- /dev/null +++ b/src/logic/contracts/artifacts/AllowanceModule.json @@ -0,0 +1,34594 @@ +{ + "contractName": "AllowanceModule", + "abi": [ + { + "constant": true, + "inputs": [], + "name": "DOMAIN_SEPARATOR_TYPEHASH", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "delegatesStart", + "outputs": [ + { + "internalType": "uint48", + "name": "", + "type": "uint48" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "ALLOWANCE_TRANSFER_TYPEHASH", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "NAME", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "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" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "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" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "tokens", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "domainSeparator", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "VERSION", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "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" + } + ], + "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" + }, + { + "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": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint96", + "name": "allowanceAmount", + "type": "uint96" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "resetTime", + "type": "uint16" + } + ], + "name": "SetAllowance", + "type": "event" + }, + { + "constant": false, + "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": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "delegate", + "type": "address" + }, + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "resetAllowance", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "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": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "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" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "safe", + "type": "address" + }, + { + "internalType": "address", + "name": "delegate", + "type": "address" + } + ], + "name": "getTokens", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "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]" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "delegate", + "type": "address" + } + ], + "name": "addDelegate", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "delegate", + "type": "address" + } + ], + "name": "removeDelegate", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "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" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + } + ], + "metadata": "{\"compiler\":{\"version\":\"0.5.11+commit.c082d0b4\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"constant\":true,\"inputs\":[],\"name\":\"DOMAIN_SEPARATOR_TYPEHASH\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"delegatesStart\",\"outputs\":[{\"internalType\":\"uint48\",\"name\":\"\",\"type\":\"uint48\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"ALLOWANCE_TRANSFER_TYPEHASH\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"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\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegate\",\"type\":\"address\"}],\"name\":\"removeDelegate\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"safe\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"delegate\",\"type\":\"address\"}],\"name\":\"getTokens\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"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]\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"NAME\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"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\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"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\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegate\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"resetAllowance\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"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\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"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\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegate\",\"type\":\"address\"}],\"name\":\"addDelegate\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"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\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"tokens\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"domainSeparator\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"VERSION\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"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\"}],\"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\"},{\"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\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"allowanceAmount\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"resetTime\",\"type\":\"uint16\"}],\"name\":\"SetAllowance\",\"type\":\"event\"}],\"devdoc\":{\"methods\":{\"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.\"}}}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/home/fer/repos/protofire/gnosis/safe-modules/allowances/contracts/AlowanceModule.sol\":\"AllowanceModule\"},\"evmVersion\":\"petersburg\",\"libraries\":{},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"/home/fer/repos/protofire/gnosis/safe-modules/allowances/contracts/AlowanceModule.sol\":{\"keccak256\":\"0x2923bedff3c94826e7a485a59d6d02d7b1821793f856695306cd6967c0b0e90c\",\"urls\":[\"bzz-raw://c19ff4e4b69c3751a32fcc654a22a385997ae16ddc945e5e99ff9392c8e5ee2b\",\"dweb:/ipfs/QmRUC5yXuamwzNsLUDCes2Q9YAya5b3WN8zr9DH9aZfr6H\"]},\"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\":{\"keccak256\":\"0x7bc6e5afb9436d9f7e376c2cdba51ca1f337e1b31c04cca5769db3a77ed40081\",\"urls\":[\"bzz-raw://88b3a68baaff962b69b040af62698034bf9c99319e4a6dce71abc2c0c88fba91\",\"dweb:/ipfs/QmTefyhXcMALQew96u7YRLQBnye9vapqkKBWxbynWpMHDM\"]},\"@gnosis.pm/safe-contracts/contracts/common/SignatureDecoder.sol\":{\"keccak256\":\"0x9d6196319963155fd0a1dd45e6d4992489da251e18572c2fc62084482edb37a9\",\"urls\":[\"bzz-raw://0298c7d98d2368bc99ae8d28befc8d40250fd7128f45095321d3c9e199fec74b\",\"dweb:/ipfs/QmPK4Q2mSnsEuv5ayyDAzURAksYXmbbALQ2Z5xUcfx1q4K\"]},\"@gnosis.pm/safe-contracts/contracts/interfaces/ISignatureValidator.sol\":{\"keccak256\":\"0xb75555e8e2bbbe38c55e164dde9761a016b0b4f1b0004b93d7ec2acd873faca4\",\"urls\":[\"bzz-raw://5985325d13e7aedb3036e9f342e740c14bf57b6202b11c2a36f95867f8c9ad5e\",\"dweb:/ipfs/QmTRKm25xk4jsTQHww3JtaU9fNp1BiM6SKoUNp5LrcLyo5\"]}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b507f035aff83d86937d35b32e04f0ddc6ff469290eef2f1b692d8a815c89404d474960001b30604051602001808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050604051602081830303815290604052805190602001206004819055506137d9806100a46000396000f3fe608060405234801561001057600080fd5b50600436106101165760003560e01c8063beaeb388116100a2578063e71bdf4111610071578063e71bdf411461094b578063eb37abe01461098f578063f56e81fa14610a5e578063f698da2514610b0c578063ffa1ad7414610b2a57610116565b8063beaeb38814610693578063c19bf50e1461072d578063ce60c69214610791578063d626e0431461085557610116565b806367e7646f116100e957806367e7646f1461034b5780638d0e8e1d1461038f57806394b31fbd14610448578063a3f4df7e14610508578063b713c9d41461058b57610116565b80631db61b541461011b578063310a3bb11461013957806343abf5fe146101a15780634515641a146101bf575b600080fd5b610123610bad565b6040518082815260200191505060405180910390f35b61017b6004803603602081101561014f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bd4565b604051808265ffffffffffff1665ffffffffffff16815260200191505060405180910390f35b6101a9610bf9565b6040518082815260200191505060405180910390f35b61034960048036036101008110156101d657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080356bffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080356bffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001906401000000008111156102c357600080fd5b8201836020820111156102d557600080fd5b803590602001918460018302840111640100000000831117156102f757600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050610c15565b005b61038d6004803603602081101561036157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611022565b005b6103f1600480360360408110156103a557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061149e565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b83811015610434578082015181840152602081019050610419565b505050509050019250505060405180910390f35b6104ca6004803603606081101561045e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506115a9565b6040518082600560200280838360005b838110156104f55780820151818401526020810190506104da565b5050505090500191505060405180910390f35b610510611635565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610550578082015181840152602081019050610535565b50505050905090810190601f16801561057d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61060d600480360360608110156105a157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061166e565b60405180866bffffffffffffffffffffffff166bffffffffffffffffffffffff168152602001856bffffffffffffffffffffffff166bffffffffffffffffffffffff1681526020018461ffff1661ffff1681526020018363ffffffff1663ffffffff1681526020018261ffff1661ffff1681526020019550505050505060405180910390f35b61072b600480360360a08110156106a957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080356bffffffffffffffffffffffff169060200190929190803561ffff169060200190929190803563ffffffff16906020019092919050505061171a565b005b61078f6004803603604081101561074357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b71565b005b6107e5600480360360408110156107a757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803565ffffffffffff169060200190929190505050611bc0565b604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018365ffffffffffff1665ffffffffffff1681526020018265ffffffffffff1665ffffffffffff168152602001935050505060405180910390f35b610935600480360360e081101561086b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080356bffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080356bffffffffffffffffffffffff169060200190929190803561ffff169060200190929190505050611c3b565b6040518082815260200191505060405180910390f35b61098d6004803603602081101561096157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c60565b005b6109f0600480360360608110156109a557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803565ffffffffffff169060200190929190803560ff1690602001909291905050506120c5565b60405180806020018365ffffffffffff1665ffffffffffff168152602001828103825284818151815260200191508051906020019060200280838360005b83811015610a49578082015181840152602081019050610a2e565b50505050905001935050505060405180910390f35b610aca60048036036060811015610a7457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061246e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610b146124c6565b6040518082815260200191505060405180910390f35b610b326124cc565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610b72578082015181840152602081019050610b57565b50505050905090810190601f168015610b9f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b7f035aff83d86937d35b32e04f0ddc6ff469290eef2f1b692d8a815c89404d474960001b81565b60036020528060005260406000206000915054906101000a900465ffffffffffff1681565b604051808061365e606c9139606c019050604051809103902081565b610c1d61353a565b610c2889848a612505565b90506060610c3f8a8a8a8a8a8a8860800151612766565b90506001826080015101826080019061ffff16908161ffff1681525050600087836020015101905082602001516bffffffffffffffffffffffff16816bffffffffffffffffffffffff16118015610cb6575082600001516bffffffffffffffffffffffff16816bffffffffffffffffffffffff1611155b610d0b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603a815260200180613723603a913960400191505060405180910390fd5b8083602001906bffffffffffffffffffffffff1690816bffffffffffffffffffffffff16815250506000866bffffffffffffffffffffffff161115610eb057610d5261353a565b8a73ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff1614610d9557610d908c878a612505565b610d97565b835b905086816020015101915080602001516bffffffffffffffffffffffff16826bffffffffffffffffffffffff16118015610df1575080600001516bffffffffffffffffffffffff16826bffffffffffffffffffffffff1611155b610e46576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252604881526020018061375d6048913960600191505060405180910390fd5b8181602001906bffffffffffffffffffffffff1690816bffffffffffffffffffffffff16815250508a73ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff1614610eae57610ead8c878a846129ab565b5b505b610ebc8b868c866129ab565b610ec88585848e612b48565b6000866bffffffffffffffffffffffff161115610eec57610eeb8b883289612c9b565b5b610ef88b8b8b8b612c9b565b8a73ffffffffffffffffffffffffffffffffffffffff167fa11cca2c2027e28ab0046aab4d4040f59d8b06e819ccd974c1e53e86aa814c19868c8c8c6001896080015103604051808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001836bffffffffffffffffffffffff166bffffffffffffffffffffffff1681526020018261ffff1661ffff1681526020019550505050505060405180910390a25050505050505050505050565b61102a613593565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008365ffffffffffff1665ffffffffffff1681526020019081526020016000206040518060600160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a900465ffffffffffff1665ffffffffffff1665ffffffffffff16815260200160008201601a9054906101000a900465ffffffffffff1665ffffffffffff1665ffffffffffff16815250509050600073ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff161415611184575061149b565b6000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060008090505b818054905081101561130157600082828154811061122457fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905061125961353a565b611264338784612505565b9050600081600001906bffffffffffffffffffffffff1690816bffffffffffffffffffffffff1681525050600081602001906bffffffffffffffffffffffff1690816bffffffffffffffffffffffff16815250506000816040019061ffff16908161ffff16815250506000816060019063ffffffff16908163ffffffff16815250506112f2338784846129ab565b5050808060010191505061120a565b508160400151600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000846020015165ffffffffffff1665ffffffffffff168152602001908152602001600020600001601a6101000a81548165ffffffffffff021916908365ffffffffffff1602179055508160200151600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000846040015165ffffffffffff1665ffffffffffff16815260200190815260200160002060000160146101000a81548165ffffffffffff021916908365ffffffffffff1602179055503373ffffffffffffffffffffffffffffffffffffffff167fdccc2d936ded24d2153d2760581a7f0dcb23ec71190c9726b3584cdd700214d484604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a250505b50565b6060600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080548060200260200160405190810160405280929190818152602001828054801561159c57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311611552575b5050505050905092915050565b6115b16135da565b6115b961353a565b6115c4858585612505565b90506040518060a0016040528082600001516bffffffffffffffffffffffff16815260200182602001516bffffffffffffffffffffffff168152602001826040015161ffff168152602001826060015163ffffffff168152602001826080015161ffff168152509150509392505050565b6040518060400160405280601081526020017f416c6c6f77616e6365204d6f64756c650000000000000000000000000000000081525081565b600060205282600052604060002060205281600052604060002060205280600052604060002060009250925050508060000160009054906101000a90046bffffffffffffffffffffffff169080600001600c9054906101000a90046bffffffffffffffffffffffff16908060000160189054906101000a900461ffff169080600001601a9054906101000a900463ffffffff169080600001601e9054906101000a900461ffff16905085565b8473ffffffffffffffffffffffffffffffffffffffff16600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008765ffffffffffff1665ffffffffffff16815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611821576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603c815260200180613622603c913960400191505060405180910390fd5b61182961353a565b611834338787612505565b90506000816080015161ffff16141561193d576001816080019061ffff16908161ffff1681525050600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208590806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505b6000603c428161194957fe5b04905060008363ffffffff161115611a11578063ffffffff168363ffffffff1611156119dd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f7265736574426173654d696e203c3d2063757272656e744d696e00000000000081525060200191505060405180910390fd5b8361ffff1683820363ffffffff16816119f257fe5b068103826060019063ffffffff16908163ffffffff1681525050611a3e565b6000826060015163ffffffff161415611a3d5780826060019063ffffffff16908163ffffffff16815250505b5b83826040019061ffff16908161ffff16815250508482600001906bffffffffffffffffffffffff1690816bffffffffffffffffffffffff1681525050611a86338888856129ab565b3373ffffffffffffffffffffffffffffffffffffffff167f49caa04c5e1e168069c09df7f88c07ca87be980b0bf4570ab77fe9aae3ca7eba88888888604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001836bffffffffffffffffffffffff166bffffffffffffffffffffffff1681526020018261ffff1661ffff16815260200194505050505060405180910390a250505050505050565b611b7961353a565b611b84338484612505565b9050600081602001906bffffffffffffffffffffffff1690816bffffffffffffffffffffffff1681525050611bbb338484846129ab565b505050565b6002602052816000526040600020602052806000526040600020600091509150508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060000160149054906101000a900465ffffffffffff169080600001601a9054906101000a900465ffffffffffff16905083565b6000611c4c88888888888888612766565b805190602001209050979650505050505050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611d03576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f496e76616c69642064656c65676174652061646472657373000000000000000081525060200191505060405180910390fd5b6000819050600073ffffffffffffffffffffffffffffffffffffffff16600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008365ffffffffffff1665ffffffffffff16815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611dc557506120c2565b6000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900465ffffffffffff16905060405180606001604052808473ffffffffffffffffffffffffffffffffffffffff168152602001600065ffffffffffff1681526020018265ffffffffffff16815250600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008465ffffffffffff1665ffffffffffff16815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160000160146101000a81548165ffffffffffff021916908365ffffffffffff160217905550604082015181600001601a6101000a81548165ffffffffffff021916908365ffffffffffff16021790555090505081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008365ffffffffffff1665ffffffffffff16815260200190815260200160002060000160146101000a81548165ffffffffffff021916908365ffffffffffff16021790555081600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548165ffffffffffff021916908365ffffffffffff1602179055503373ffffffffffffffffffffffffffffffffffffffff167f2fd5b26f00131bd8ca0fc556207292b85a6bec241341df82724333227458e63084604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a250505b50565b606060008260ff166040519080825280602002602001820160405280156120fb5781602001602082028038833980820191505090505b50915060008090506000808665ffffffffffff16141561216c57600360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900465ffffffffffff1661216e565b855b9050612178613593565b600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008365ffffffffffff1665ffffffffffff1681526020019081526020016000206040518060600160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a900465ffffffffffff1665ffffffffffff1665ffffffffffff16815260200160008201601a9054906101000a900465ffffffffffff1665ffffffffffff1665ffffffffffff168152505090505b600073ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff16141580156122da57508560ff168360ff16105b15612459578060000151858460ff16815181106122f357fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508280600101935050600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000826040015165ffffffffffff1665ffffffffffff1681526020019081526020016000206040518060600160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a900465ffffffffffff1665ffffffffffff1665ffffffffffff16815260200160008201601a9054906101000a900465ffffffffffff1665ffffffffffff1665ffffffffffff16815250509050612294565b80600001519350828552505050935093915050565b6001602052826000526040600020602052816000526040600020818154811061249357fe5b90600052602060002001600092509250509054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60045481565b6040518060400160405280600581526020017f302e312e3000000000000000000000000000000000000000000000000000000081525081565b61250d61353a565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040518060a00160405290816000820160009054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff166bffffffffffffffffffffffff16815260200160008201600c9054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff166bffffffffffffffffffffffff1681526020016000820160189054906101000a900461ffff1661ffff1661ffff16815260200160008201601a9054906101000a900463ffffffff1663ffffffff1663ffffffff16815260200160008201601e9054906101000a900461ffff1661ffff1661ffff168152505090506000603c42816126c057fe5b0490506000826040015161ffff161180156126f55750816040015161ffff16810363ffffffff16826060015163ffffffff1611155b1561275b57600082602001906bffffffffffffffffffffffff1690816bffffffffffffffffffffffff1681525050816040015161ffff168260600151820363ffffffff168161274057fe5b068103826060019063ffffffff16908163ffffffff16815250505b819150509392505050565b60606000604051808061365e606c9139606c019050604051809103902089898989898989604051602001808981526020018873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001856bffffffffffffffffffffffff166bffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001836bffffffffffffffffffffffff166bffffffffffffffffffffffff1681526020018261ffff1661ffff16815260200198505050505050505050604051602081830303815290604052805190602001209050601960f81b600160f81b6004548360405160200180857effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19168152600101847effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19168152600101838152602001828152602001945050505050604051602081830303815290604052915050979650505050505050565b806000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff160217905550602082015181600001600c6101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff16021790555060408201518160000160186101000a81548161ffff021916908361ffff160217905550606082015181600001601a6101000a81548163ffffffff021916908363ffffffff160217905550608082015181600001601e6101000a81548161ffff021916908361ffff16021790555090505050505050565b6000612b5484846130e5565b90508073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16148015612c3f57508073ffffffffffffffffffffffffffffffffffffffff16600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008365ffffffffffff1665ffffffffffff16815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b612c94576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260598152602001806136ca6059913960600191505060405180910390fd5b5050505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415612e42578373ffffffffffffffffffffffffffffffffffffffff1663468721a7838360006040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001836bffffffffffffffffffffffff16815260200180602001836001811115612d5957fe5b60ff168152602001828103825260008152602001602001945050505050602060405180830381600087803b158015612d9057600080fd5b505af1158015612da4573d6000803e3d6000fd5b505050506040513d6020811015612dba57600080fd5b8101908080519060200190929190505050612e3d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f436f756c64206e6f742065786563757465206574686572207472616e7366657281525060200191505060405180910390fd5b6130df565b60608282604051602401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001826bffffffffffffffffffffffff166bffffffffffffffffffffffff168152602001925050506040516020818303038152906040527fa9059cbb000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090508473ffffffffffffffffffffffffffffffffffffffff1663468721a78560008460006040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200180602001836001811115612fa157fe5b60ff168152602001828103825284818151815260200191508051906020019080838360005b83811015612fe1578082015181840152602081019050612fc6565b50505050905090810190601f16801561300e5780820380516001836020036101000a031916815260200191505b5095505050505050602060405180830381600087803b15801561303057600080fd5b505af1158015613044573d6000803e3d6000fd5b505050506040513d602081101561305a57600080fd5b81019080805190602001909291905050506130dd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f436f756c64206e6f74206578656375746520746f6b656e207472616e7366657281525060200191505060405180910390fd5b505b50505050565b600080835114156130f857339050613505565b604183511015613170576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f7369676e6174757265732e6c656e677468203e3d20363500000000000000000081525060200191505060405180910390fd5b600080600061318086600061350b565b80935081945082955050505060008360ff1614156133a8578160001c9350606060208288010190506320c13b0b60e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19168573ffffffffffffffffffffffffffffffffffffffff166320c13b0b88846040518363ffffffff1660e01b8152600401808060200180602001838103835285818151815260200191508051906020019080838360005b83811015613240578082015181840152602081019050613225565b50505050905090810190601f16801561326d5780820380516001836020036101000a031916815260200191505b50838103825284818151815260200191508051906020019080838360005b838110156132a657808201518184015260208101905061328b565b50505050905090810190601f1680156132d35780820380516001836020036101000a031916815260200191505b5094505050505060206040518083038186803b1580156132f257600080fd5b505afa158015613306573d6000803e3d6000fd5b505050506040513d602081101561331c57600080fd5b81019080805190602001909291905050507bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916146133a2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806135fd6025913960400191505060405180910390fd5b50613501565b60018360ff1614156133bc57339350613500565b601e8360ff16111561348e576001858051906020012060405160200180807f19457468657265756d205369676e6564204d6573736167653a0a333200000000815250601c018281526020019150506040516020818303038152906040528051906020012060048503848460405160008152602001604052604051808581526020018460ff1660ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa15801561347d573d6000803e3d6000fd5b5050506020604051035193506134ff565b6001858051906020012084848460405160008152602001604052604051808581526020018460ff1660ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa1580156134f2573d6000803e3d6000fd5b5050506020604051035193505b5b5b5050505b92915050565b60008060008360410260208101860151925060408101860151915060ff60418201870151169350509250925092565b6040518060a0016040528060006bffffffffffffffffffffffff16815260200160006bffffffffffffffffffffffff168152602001600061ffff168152602001600063ffffffff168152602001600061ffff1681525090565b6040518060600160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600065ffffffffffff168152602001600065ffffffffffff1681525090565b6040518060a0016040528060059060208202803883398082019150509050509056fe436f756c64206e6f742076616c6964617465204549502d31323731207369676e617475726564656c6567617465735b6d73672e73656e6465725d5b75696e7434382864656c6567617465295d2e64656c6567617465203d3d2064656c6567617465416c6c6f77616e63655472616e73666572286164647265737320736166652c6164647265737320746f6b656e2c75696e74393620616d6f756e742c61646472657373207061796d656e74546f6b656e2c75696e743936207061796d656e742c75696e743136206e6f6e636529657870656374656444656c6567617465203d3d207369676e65722026262064656c6567617465735b616464726573732873616665295d5b75696e743438287369676e6572295d2e64656c6567617465203d3d207369676e65726e65775370656e74203e20616c6c6f77616e63652e7370656e74202626206e65775370656e74203c3d20616c6c6f77616e63652e616d6f756e746e65775370656e74203e207061796d656e74416c6c6f77616e63652e7370656e74202626206e65775370656e74203c3d207061796d656e74416c6c6f77616e63652e616d6f756e74a265627a7a72315820d3b549675e0dc47e816c54dd93e764695886843e99d7cb6e2e49bf154ee462db64736f6c634300050b0032", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101165760003560e01c8063beaeb388116100a2578063e71bdf4111610071578063e71bdf411461094b578063eb37abe01461098f578063f56e81fa14610a5e578063f698da2514610b0c578063ffa1ad7414610b2a57610116565b8063beaeb38814610693578063c19bf50e1461072d578063ce60c69214610791578063d626e0431461085557610116565b806367e7646f116100e957806367e7646f1461034b5780638d0e8e1d1461038f57806394b31fbd14610448578063a3f4df7e14610508578063b713c9d41461058b57610116565b80631db61b541461011b578063310a3bb11461013957806343abf5fe146101a15780634515641a146101bf575b600080fd5b610123610bad565b6040518082815260200191505060405180910390f35b61017b6004803603602081101561014f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bd4565b604051808265ffffffffffff1665ffffffffffff16815260200191505060405180910390f35b6101a9610bf9565b6040518082815260200191505060405180910390f35b61034960048036036101008110156101d657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080356bffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080356bffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001906401000000008111156102c357600080fd5b8201836020820111156102d557600080fd5b803590602001918460018302840111640100000000831117156102f757600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050610c15565b005b61038d6004803603602081101561036157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611022565b005b6103f1600480360360408110156103a557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061149e565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b83811015610434578082015181840152602081019050610419565b505050509050019250505060405180910390f35b6104ca6004803603606081101561045e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506115a9565b6040518082600560200280838360005b838110156104f55780820151818401526020810190506104da565b5050505090500191505060405180910390f35b610510611635565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610550578082015181840152602081019050610535565b50505050905090810190601f16801561057d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61060d600480360360608110156105a157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061166e565b60405180866bffffffffffffffffffffffff166bffffffffffffffffffffffff168152602001856bffffffffffffffffffffffff166bffffffffffffffffffffffff1681526020018461ffff1661ffff1681526020018363ffffffff1663ffffffff1681526020018261ffff1661ffff1681526020019550505050505060405180910390f35b61072b600480360360a08110156106a957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080356bffffffffffffffffffffffff169060200190929190803561ffff169060200190929190803563ffffffff16906020019092919050505061171a565b005b61078f6004803603604081101561074357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b71565b005b6107e5600480360360408110156107a757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803565ffffffffffff169060200190929190505050611bc0565b604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018365ffffffffffff1665ffffffffffff1681526020018265ffffffffffff1665ffffffffffff168152602001935050505060405180910390f35b610935600480360360e081101561086b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080356bffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080356bffffffffffffffffffffffff169060200190929190803561ffff169060200190929190505050611c3b565b6040518082815260200191505060405180910390f35b61098d6004803603602081101561096157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c60565b005b6109f0600480360360608110156109a557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803565ffffffffffff169060200190929190803560ff1690602001909291905050506120c5565b60405180806020018365ffffffffffff1665ffffffffffff168152602001828103825284818151815260200191508051906020019060200280838360005b83811015610a49578082015181840152602081019050610a2e565b50505050905001935050505060405180910390f35b610aca60048036036060811015610a7457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061246e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610b146124c6565b6040518082815260200191505060405180910390f35b610b326124cc565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610b72578082015181840152602081019050610b57565b50505050905090810190601f168015610b9f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b7f035aff83d86937d35b32e04f0ddc6ff469290eef2f1b692d8a815c89404d474960001b81565b60036020528060005260406000206000915054906101000a900465ffffffffffff1681565b604051808061365e606c9139606c019050604051809103902081565b610c1d61353a565b610c2889848a612505565b90506060610c3f8a8a8a8a8a8a8860800151612766565b90506001826080015101826080019061ffff16908161ffff1681525050600087836020015101905082602001516bffffffffffffffffffffffff16816bffffffffffffffffffffffff16118015610cb6575082600001516bffffffffffffffffffffffff16816bffffffffffffffffffffffff1611155b610d0b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603a815260200180613723603a913960400191505060405180910390fd5b8083602001906bffffffffffffffffffffffff1690816bffffffffffffffffffffffff16815250506000866bffffffffffffffffffffffff161115610eb057610d5261353a565b8a73ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff1614610d9557610d908c878a612505565b610d97565b835b905086816020015101915080602001516bffffffffffffffffffffffff16826bffffffffffffffffffffffff16118015610df1575080600001516bffffffffffffffffffffffff16826bffffffffffffffffffffffff1611155b610e46576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252604881526020018061375d6048913960600191505060405180910390fd5b8181602001906bffffffffffffffffffffffff1690816bffffffffffffffffffffffff16815250508a73ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff1614610eae57610ead8c878a846129ab565b5b505b610ebc8b868c866129ab565b610ec88585848e612b48565b6000866bffffffffffffffffffffffff161115610eec57610eeb8b883289612c9b565b5b610ef88b8b8b8b612c9b565b8a73ffffffffffffffffffffffffffffffffffffffff167fa11cca2c2027e28ab0046aab4d4040f59d8b06e819ccd974c1e53e86aa814c19868c8c8c6001896080015103604051808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001836bffffffffffffffffffffffff166bffffffffffffffffffffffff1681526020018261ffff1661ffff1681526020019550505050505060405180910390a25050505050505050505050565b61102a613593565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008365ffffffffffff1665ffffffffffff1681526020019081526020016000206040518060600160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a900465ffffffffffff1665ffffffffffff1665ffffffffffff16815260200160008201601a9054906101000a900465ffffffffffff1665ffffffffffff1665ffffffffffff16815250509050600073ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff161415611184575061149b565b6000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060008090505b818054905081101561130157600082828154811061122457fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905061125961353a565b611264338784612505565b9050600081600001906bffffffffffffffffffffffff1690816bffffffffffffffffffffffff1681525050600081602001906bffffffffffffffffffffffff1690816bffffffffffffffffffffffff16815250506000816040019061ffff16908161ffff16815250506000816060019063ffffffff16908163ffffffff16815250506112f2338784846129ab565b5050808060010191505061120a565b508160400151600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000846020015165ffffffffffff1665ffffffffffff168152602001908152602001600020600001601a6101000a81548165ffffffffffff021916908365ffffffffffff1602179055508160200151600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000846040015165ffffffffffff1665ffffffffffff16815260200190815260200160002060000160146101000a81548165ffffffffffff021916908365ffffffffffff1602179055503373ffffffffffffffffffffffffffffffffffffffff167fdccc2d936ded24d2153d2760581a7f0dcb23ec71190c9726b3584cdd700214d484604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a250505b50565b6060600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080548060200260200160405190810160405280929190818152602001828054801561159c57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311611552575b5050505050905092915050565b6115b16135da565b6115b961353a565b6115c4858585612505565b90506040518060a0016040528082600001516bffffffffffffffffffffffff16815260200182602001516bffffffffffffffffffffffff168152602001826040015161ffff168152602001826060015163ffffffff168152602001826080015161ffff168152509150509392505050565b6040518060400160405280601081526020017f416c6c6f77616e6365204d6f64756c650000000000000000000000000000000081525081565b600060205282600052604060002060205281600052604060002060205280600052604060002060009250925050508060000160009054906101000a90046bffffffffffffffffffffffff169080600001600c9054906101000a90046bffffffffffffffffffffffff16908060000160189054906101000a900461ffff169080600001601a9054906101000a900463ffffffff169080600001601e9054906101000a900461ffff16905085565b8473ffffffffffffffffffffffffffffffffffffffff16600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008765ffffffffffff1665ffffffffffff16815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611821576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603c815260200180613622603c913960400191505060405180910390fd5b61182961353a565b611834338787612505565b90506000816080015161ffff16141561193d576001816080019061ffff16908161ffff1681525050600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208590806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505b6000603c428161194957fe5b04905060008363ffffffff161115611a11578063ffffffff168363ffffffff1611156119dd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f7265736574426173654d696e203c3d2063757272656e744d696e00000000000081525060200191505060405180910390fd5b8361ffff1683820363ffffffff16816119f257fe5b068103826060019063ffffffff16908163ffffffff1681525050611a3e565b6000826060015163ffffffff161415611a3d5780826060019063ffffffff16908163ffffffff16815250505b5b83826040019061ffff16908161ffff16815250508482600001906bffffffffffffffffffffffff1690816bffffffffffffffffffffffff1681525050611a86338888856129ab565b3373ffffffffffffffffffffffffffffffffffffffff167f49caa04c5e1e168069c09df7f88c07ca87be980b0bf4570ab77fe9aae3ca7eba88888888604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001836bffffffffffffffffffffffff166bffffffffffffffffffffffff1681526020018261ffff1661ffff16815260200194505050505060405180910390a250505050505050565b611b7961353a565b611b84338484612505565b9050600081602001906bffffffffffffffffffffffff1690816bffffffffffffffffffffffff1681525050611bbb338484846129ab565b505050565b6002602052816000526040600020602052806000526040600020600091509150508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060000160149054906101000a900465ffffffffffff169080600001601a9054906101000a900465ffffffffffff16905083565b6000611c4c88888888888888612766565b805190602001209050979650505050505050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611d03576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f496e76616c69642064656c65676174652061646472657373000000000000000081525060200191505060405180910390fd5b6000819050600073ffffffffffffffffffffffffffffffffffffffff16600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008365ffffffffffff1665ffffffffffff16815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611dc557506120c2565b6000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900465ffffffffffff16905060405180606001604052808473ffffffffffffffffffffffffffffffffffffffff168152602001600065ffffffffffff1681526020018265ffffffffffff16815250600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008465ffffffffffff1665ffffffffffff16815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160000160146101000a81548165ffffffffffff021916908365ffffffffffff160217905550604082015181600001601a6101000a81548165ffffffffffff021916908365ffffffffffff16021790555090505081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008365ffffffffffff1665ffffffffffff16815260200190815260200160002060000160146101000a81548165ffffffffffff021916908365ffffffffffff16021790555081600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548165ffffffffffff021916908365ffffffffffff1602179055503373ffffffffffffffffffffffffffffffffffffffff167f2fd5b26f00131bd8ca0fc556207292b85a6bec241341df82724333227458e63084604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a250505b50565b606060008260ff166040519080825280602002602001820160405280156120fb5781602001602082028038833980820191505090505b50915060008090506000808665ffffffffffff16141561216c57600360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900465ffffffffffff1661216e565b855b9050612178613593565b600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008365ffffffffffff1665ffffffffffff1681526020019081526020016000206040518060600160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a900465ffffffffffff1665ffffffffffff1665ffffffffffff16815260200160008201601a9054906101000a900465ffffffffffff1665ffffffffffff1665ffffffffffff168152505090505b600073ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff16141580156122da57508560ff168360ff16105b15612459578060000151858460ff16815181106122f357fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508280600101935050600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000826040015165ffffffffffff1665ffffffffffff1681526020019081526020016000206040518060600160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a900465ffffffffffff1665ffffffffffff1665ffffffffffff16815260200160008201601a9054906101000a900465ffffffffffff1665ffffffffffff1665ffffffffffff16815250509050612294565b80600001519350828552505050935093915050565b6001602052826000526040600020602052816000526040600020818154811061249357fe5b90600052602060002001600092509250509054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60045481565b6040518060400160405280600581526020017f302e312e3000000000000000000000000000000000000000000000000000000081525081565b61250d61353a565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040518060a00160405290816000820160009054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff166bffffffffffffffffffffffff16815260200160008201600c9054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff166bffffffffffffffffffffffff1681526020016000820160189054906101000a900461ffff1661ffff1661ffff16815260200160008201601a9054906101000a900463ffffffff1663ffffffff1663ffffffff16815260200160008201601e9054906101000a900461ffff1661ffff1661ffff168152505090506000603c42816126c057fe5b0490506000826040015161ffff161180156126f55750816040015161ffff16810363ffffffff16826060015163ffffffff1611155b1561275b57600082602001906bffffffffffffffffffffffff1690816bffffffffffffffffffffffff1681525050816040015161ffff168260600151820363ffffffff168161274057fe5b068103826060019063ffffffff16908163ffffffff16815250505b819150509392505050565b60606000604051808061365e606c9139606c019050604051809103902089898989898989604051602001808981526020018873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001856bffffffffffffffffffffffff166bffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001836bffffffffffffffffffffffff166bffffffffffffffffffffffff1681526020018261ffff1661ffff16815260200198505050505050505050604051602081830303815290604052805190602001209050601960f81b600160f81b6004548360405160200180857effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19168152600101847effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19168152600101838152602001828152602001945050505050604051602081830303815290604052915050979650505050505050565b806000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff160217905550602082015181600001600c6101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff16021790555060408201518160000160186101000a81548161ffff021916908361ffff160217905550606082015181600001601a6101000a81548163ffffffff021916908363ffffffff160217905550608082015181600001601e6101000a81548161ffff021916908361ffff16021790555090505050505050565b6000612b5484846130e5565b90508073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16148015612c3f57508073ffffffffffffffffffffffffffffffffffffffff16600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008365ffffffffffff1665ffffffffffff16815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b612c94576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260598152602001806136ca6059913960600191505060405180910390fd5b5050505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415612e42578373ffffffffffffffffffffffffffffffffffffffff1663468721a7838360006040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001836bffffffffffffffffffffffff16815260200180602001836001811115612d5957fe5b60ff168152602001828103825260008152602001602001945050505050602060405180830381600087803b158015612d9057600080fd5b505af1158015612da4573d6000803e3d6000fd5b505050506040513d6020811015612dba57600080fd5b8101908080519060200190929190505050612e3d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f436f756c64206e6f742065786563757465206574686572207472616e7366657281525060200191505060405180910390fd5b6130df565b60608282604051602401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001826bffffffffffffffffffffffff166bffffffffffffffffffffffff168152602001925050506040516020818303038152906040527fa9059cbb000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090508473ffffffffffffffffffffffffffffffffffffffff1663468721a78560008460006040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200180602001836001811115612fa157fe5b60ff168152602001828103825284818151815260200191508051906020019080838360005b83811015612fe1578082015181840152602081019050612fc6565b50505050905090810190601f16801561300e5780820380516001836020036101000a031916815260200191505b5095505050505050602060405180830381600087803b15801561303057600080fd5b505af1158015613044573d6000803e3d6000fd5b505050506040513d602081101561305a57600080fd5b81019080805190602001909291905050506130dd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f436f756c64206e6f74206578656375746520746f6b656e207472616e7366657281525060200191505060405180910390fd5b505b50505050565b600080835114156130f857339050613505565b604183511015613170576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f7369676e6174757265732e6c656e677468203e3d20363500000000000000000081525060200191505060405180910390fd5b600080600061318086600061350b565b80935081945082955050505060008360ff1614156133a8578160001c9350606060208288010190506320c13b0b60e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19168573ffffffffffffffffffffffffffffffffffffffff166320c13b0b88846040518363ffffffff1660e01b8152600401808060200180602001838103835285818151815260200191508051906020019080838360005b83811015613240578082015181840152602081019050613225565b50505050905090810190601f16801561326d5780820380516001836020036101000a031916815260200191505b50838103825284818151815260200191508051906020019080838360005b838110156132a657808201518184015260208101905061328b565b50505050905090810190601f1680156132d35780820380516001836020036101000a031916815260200191505b5094505050505060206040518083038186803b1580156132f257600080fd5b505afa158015613306573d6000803e3d6000fd5b505050506040513d602081101561331c57600080fd5b81019080805190602001909291905050507bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916146133a2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806135fd6025913960400191505060405180910390fd5b50613501565b60018360ff1614156133bc57339350613500565b601e8360ff16111561348e576001858051906020012060405160200180807f19457468657265756d205369676e6564204d6573736167653a0a333200000000815250601c018281526020019150506040516020818303038152906040528051906020012060048503848460405160008152602001604052604051808581526020018460ff1660ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa15801561347d573d6000803e3d6000fd5b5050506020604051035193506134ff565b6001858051906020012084848460405160008152602001604052604051808581526020018460ff1660ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa1580156134f2573d6000803e3d6000fd5b5050506020604051035193505b5b5b5050505b92915050565b60008060008360410260208101860151925060408101860151915060ff60418201870151169350509250925092565b6040518060a0016040528060006bffffffffffffffffffffffff16815260200160006bffffffffffffffffffffffff168152602001600061ffff168152602001600063ffffffff168152602001600061ffff1681525090565b6040518060600160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600065ffffffffffff168152602001600065ffffffffffff1681525090565b6040518060a0016040528060059060208202803883398082019150509050509056fe436f756c64206e6f742076616c6964617465204549502d31323731207369676e617475726564656c6567617465735b6d73672e73656e6465725d5b75696e7434382864656c6567617465295d2e64656c6567617465203d3d2064656c6567617465416c6c6f77616e63655472616e73666572286164647265737320736166652c6164647265737320746f6b656e2c75696e74393620616d6f756e742c61646472657373207061796d656e74546f6b656e2c75696e743936207061796d656e742c75696e743136206e6f6e636529657870656374656444656c6567617465203d3d207369676e65722026262064656c6567617465735b616464726573732873616665295d5b75696e743438287369676e6572295d2e64656c6567617465203d3d207369676e65726e65775370656e74203e20616c6c6f77616e63652e7370656e74202626206e65775370656e74203c3d20616c6c6f77616e63652e616d6f756e746e65775370656e74203e207061796d656e74416c6c6f77616e63652e7370656e74202626206e65775370656e74203c3d207061796d656e74416c6c6f77616e63652e616d6f756e74a265627a7a72315820d3b549675e0dc47e816c54dd93e764695886843e99d7cb6e2e49bf154ee462db64736f6c634300050b0032", + "sourceMap": "769:13528:0:-;;;2421:140;8:9:-1;5:2;;;30:1;27;20:12;5:2;2421:140:0;1082:66;2521:25;;2548:4;2510:43;;;;;;;;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;2510:43:0;;;2500:54;;;;;;2482:15;:72;;;;769:13528;;;;;;", + "deployedSourceMap": "769:13528:0:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;769:13528:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1030:118;;;:::i;:::-;;;;;;;;;;;;;;;;;;;1654:48;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;1654:48:0;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;1186:189;;;:::i;:::-;;;;;;;;;;;;;;;;;;;5344:2246;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;5344:2246:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;21:11:-1;8;5:28;2:2;;;46:1;43;36:12;2:2;5344:2246:0;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;5344:2246:0;;;;;;100:9:-1;95:1;81:12;77:20;67:8;63:35;60:50;39:11;25:12;22:29;11:107;8:2;;;131:1;128;121:12;8:2;5344:2246:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;93:3;85:6;81:16;74:27;137:4;133:9;126:4;121:3;117:14;113:30;106:37;;169:3;161:6;157:16;147:26;;5344:2246:0;;;;;;;;;;;;;;;:::i;:::-;;12563:967;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;12563:967:0;;;;;;;;;;;;;;;;;;;:::i;:::-;;11419:136;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;11419:136:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;11419:136:0;;;;;;;;;;;;;;;;;11561:427;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;11561:427:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;11561:427:0;;;;;;;;;;;;;;;;851:48;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;851:48:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1419:88;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;1419:88:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3013:1311;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;3013:1311:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;5093:245;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;5093:245:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;1583:65;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;1583:65:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8097:366;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;8097:366:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;11994:563;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;11994:563:0;;;;;;;;;;;;;;;;;;;:::i;:::-;;13536:759;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;13536:759:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;13536:759:0;;;;;;;;;;;;;;;;;;1513:64;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;1513:64:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;1708:30;;;:::i;:::-;;;;;;;;;;;;;;;;;;;905:40;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;905:40:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1030:118;1082:66;1030:118;;;:::o;1654:48::-;;;;;;;;;;;;;;;;;;;;;;:::o;1186:189::-;1240:135;;;;;;;;;;;;;;;;;;;1186:189;:::o;5344:2246::-;5641:26;;:::i;:::-;5670:44;5691:4;5698:8;5708:5;5670:12;:44::i;:::-;5641:73;;5724:29;5756:98;5789:4;5796:5;5803:2;5807:6;5815:12;5829:7;5838:9;:15;;;5756:24;:98::i;:::-;5724:130;;5933:1;5915:9;:15;;;:19;5897:9;:15;;:37;;;;;;;;;;;5944:15;5980:6;5962:9;:15;;;:24;5944:42;;6062:9;:15;;;6051:26;;:8;:26;;;:58;;;;;6093:9;:16;;;6081:28;;:8;:28;;;;6051:58;6043:129;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6200:8;6182:9;:15;;:26;;;;;;;;;;;6232:1;6222:7;:11;;;6218:748;;;6325:33;;:::i;:::-;6377:5;6361:21;;:12;:21;;;:87;;6397:51;6418:4;6425:8;6435:12;6397;:51::i;:::-;6361:87;;;6385:9;6361:87;6325:123;;6498:7;6473:16;:22;;;:32;6462:43;;6589:16;:22;;;6578:33;;:8;:33;;;:72;;;;;6627:16;:23;;;6615:35;;:8;:35;;;;6578:72;6570:157;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6766:8;6741:16;:22;;:33;;;;;;;;;;;6876:5;6860:21;;:12;:21;;;6856:99;;6883:72;6907:4;6914:8;6924:12;6938:16;6883:15;:72::i;:::-;6856:99;6218:748;;6975:58;6999:4;7006:8;7016:5;7023:9;6975:15;:58::i;:::-;7157:59;7172:8;7182:9;7193:16;7211:4;7157:14;:59::i;:::-;7241:1;7231:7;:11;;;7227:184;;;7352:48;7361:4;7367:12;7381:9;7392:7;7352:8;:48::i;:::-;7227:184;7446:33;7455:4;7461:5;7468:2;7472:6;7446:8;:33::i;:::-;7527:4;7494:89;;;7534:8;7544:5;7551:2;7555:6;7581:1;7563:9;:15;;;:19;7494:89;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5344:2246;;;;;;;;;;;:::o;12563:967::-;12622:23;;:::i;:::-;12648:9;:21;12658:10;12648:21;;;;;;;;;;;;;;;:39;12677:8;12648:39;;;;;;;;;;;;;;;12622:65;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;12778:1;12750:30;;:7;:16;;;:30;;;12747:42;;;12782:7;;;12747:42;12798:32;12833:6;:18;12840:10;12833:18;;;;;;;;;;;;;;;:28;12852:8;12833:28;;;;;;;;;;;;;;;12798:63;;12876:9;12888:1;12876:13;;12871:472;12895:14;:21;;;;12891:1;:25;12871:472;;;12937:13;12953:14;12968:1;12953:17;;;;;;;;;;;;;;;;;;;;;;;;;12937:33;;13046:26;;:::i;:::-;13075:41;13088:10;13100:8;13110:5;13075:12;:41::i;:::-;13046:70;;13149:1;13130:9;:16;;:20;;;;;;;;;;;13182:1;13164:9;:15;;:19;;;;;;;;;;;13222:1;13197:9;:22;;:26;;;;;;;;;;;13262:1;13237:9;:22;;:26;;;;;;;;;;;13277:55;13293:10;13305:8;13315:5;13322:9;13277:15;:55::i;:::-;12871:472;;12918:3;;;;;;;12871:472;;;;13395:7;:12;;;13352:9;:21;13362:10;13352:21;;;;;;;;;;;;;;;:35;13374:7;:12;;;13352:35;;;;;;;;;;;;;;;:40;;;:55;;;;;;;;;;;;;;;;;;13460:7;:12;;;13417:9;:21;13427:10;13417:21;;;;;;;;;;;;;;;:35;13439:7;:12;;;13417:35;;;;;;;;;;;;;;;:40;;;:55;;;;;;;;;;;;;;;;;;13502:10;13487:36;;;13514:8;13487:36;;;;;;;;;;;;;;;;;;;;;;12563:967;;;;:::o;11419:136::-;11491:16;11526:6;:12;11533:4;11526:12;;;;;;;;;;;;;;;:22;11539:8;11526:22;;;;;;;;;;;;;;;11519:29;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;11419:136;;;;:::o;11561:427::-;11656:17;;:::i;:::-;11685:26;;:::i;:::-;11714:35;11727:4;11733:8;11743:5;11714:12;:35::i;:::-;11685:64;;11759:222;;;;;;;;11788:9;:16;;;11780:25;;11759:222;;;;11827:9;:15;;;11819:24;;11759:222;;;;11865:9;:22;;;11857:31;;11759:222;;;;11910:9;:22;;;11902:31;;11759:222;;;;11955:9;:15;;;11947:24;;11759:222;;;;;;11561:427;;;;;:::o;851:48::-;;;;;;;;;;;;;;;;;;;:::o;1419:88::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;3013:1311::-;3223:8;3171:60;;:9;:21;3181:10;3171:21;;;;;;;;;;;;;;;:39;3200:8;3171:39;;;;;;;;;;;;;;;:48;;;;;;;;;;;;:60;;;3163:133;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3306:26;;:::i;:::-;3335:41;3348:10;3360:8;3370:5;3335:12;:41::i;:::-;3306:70;;3409:1;3390:9;:15;;;:20;;;3386:210;;;3530:1;3512:9;:15;;:19;;;;;;;;;;;3545:6;:18;3552:10;3545:18;;;;;;;;;;;;;;;:28;3564:8;3545:28;;;;;;;;;;;;;;;3579:5;3545:40;;39:1:-1;33:3;27:10;23:18;57:10;52:3;45:23;79:10;72:17;;0:93;3545:40:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3386:210;3722:17;3755:2;3749:3;:8;;;;;;3722:36;;3787:1;3772:12;:16;;;3768:307;;;3828:10;3812:26;;:12;:26;;;;3804:65;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3952:12;3922:42;;3936:12;3923:10;:25;3922:42;;;;;;;;3908:10;:57;3883:9;:22;;:82;;;;;;;;;;;3768:307;;;4012:1;3986:9;:22;;;:27;;;3982:93;;;4054:10;4029:9;:22;;:35;;;;;;;;;;;3982:93;3768:307;4109:12;4084:9;:22;;:37;;;;;;;;;;;4150:15;4131:9;:16;;:34;;;;;;;;;;;4175:55;4191:10;4203:8;4213:5;4220:9;4175:15;:55::i;:::-;4258:10;4245:72;;;4270:8;4280:5;4287:15;4304:12;4245:72;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3013:1311;;;;;;;:::o;5093:245::-;5167:26;;:::i;:::-;5196:41;5209:10;5221:8;5231:5;5196:12;:41::i;:::-;5167:70;;5265:1;5247:9;:15;;:19;;;;;;;;;;;5276:55;5292:10;5304:8;5314:5;5321:9;5276:15;:55::i;:::-;5093:245;;;:::o;1583:65::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;8097:366::-;8318:7;8354:101;8392:4;8398:5;8405:2;8409:6;8417:12;8431:7;8440:5;8354:24;:101::i;:::-;8344:112;;;;;;8337:119;;8097:366;;;;;;;;;:::o;11994:563::-;12078:1;12058:22;;:8;:22;;;;12050:59;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;12119:12;12141:8;12119:31;;12262:1;12213:51;;:9;:21;12223:10;12213:21;;;;;;;;;;;;;;;:28;12235:5;12213:28;;;;;;;;;;;;;;;:37;;;;;;;;;;;;:51;;;12210:63;;12266:7;;;12210:63;12282:17;12302:14;:26;12317:10;12302:26;;;;;;;;;;;;;;;;;;;;;;;;;12282:46;;12369:33;;;;;;;;12378:8;12369:33;;;;;;12388:1;12369:33;;;;;;12391:10;12369:33;;;;;12338:9;:21;12348:10;12338:21;;;;;;;;;;;;;;;:28;12360:5;12338:28;;;;;;;;;;;;;;;:64;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;12453:5;12412:9;:21;12422:10;12412:21;;;;;;;;;;;;;;;:33;12434:10;12412:33;;;;;;;;;;;;;;;:38;;;:46;;;;;;;;;;;;;;;;;;12497:5;12468:14;:26;12483:10;12468:26;;;;;;;;;;;;;;;;:34;;;;;;;;;;;;;;;;;;12529:10;12517:33;;;12541:8;12517:33;;;;;;;;;;;;;;;;;;;;;;11994:563;;;;:::o;13536:759::-;13623:24;13649:11;13696:8;13682:23;;;;;;;;;;;;;;;;;;;;;;;;29:2:-1;21:6;17:15;117:4;105:10;97:6;88:34;148:4;140:6;136:17;126:27;;0:157;13682:23:0;;;;13672:33;;13715:7;13725:1;13715:11;;13736:19;13768:1;13759:5;:10;;;;13758:43;;13781:14;:20;13796:4;13781:20;;;;;;;;;;;;;;;;;;;;;;;;;13758:43;;;13773:5;13758:43;13736:65;;13811:23;;:::i;:::-;13837:9;:15;13847:4;13837:15;;;;;;;;;;;;;;;:29;13853:12;13837:29;;;;;;;;;;;;;;;13811:55;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;13876:178;13910:1;13882:30;;:7;:16;;;:30;;;;:46;;;;;13920:8;13916:12;;:1;:12;;;13882:46;13876:178;;;13957:7;:16;;;13944:7;13952:1;13944:10;;;;;;;;;;;;;;;:29;;;;;;;;;;;13987:3;;;;;;;14014:9;:15;14024:4;14014:15;;;;;;;;;;;;;;;:29;14030:7;:12;;;14014:29;;;;;;;;;;;;;;;14004:39;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;13876:178;;;14077:7;:16;;;14063:31;;14277:1;14268:7;14261:18;14247:42;;;;;;;;;:::o;1513:64::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;1708:30::-;;;;:::o;905:40::-;;;;;;;;;;;;;;;;;;;:::o;4330:581::-;4421:26;;:::i;:::-;4471:10;:16;4482:4;4471:16;;;;;;;;;;;;;;;:26;4488:8;4471:26;;;;;;;;;;;;;;;:33;4498:5;4471:33;;;;;;;;;;;;;;;4459:45;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4576:17;4609:2;4603:3;:8;;;;;;4576:36;;4651:1;4626:9;:22;;;:26;;;:91;;;;;4695:9;:22;;;4682:35;;:10;:35;4656:61;;:9;:22;;;:61;;;;4626:91;4622:257;;;4751:1;4733:9;:15;;:19;;;;;;;;;;;4845:9;:22;;;4805:62;;4819:9;:22;;;4806:10;:35;4805:62;;;;;;;;4791:10;:77;4766:9;:22;;:102;;;;;;;;;;;4622:257;4895:9;4888:16;;;4330:581;;;;;:::o;7596:495::-;7822:12;7846:20;1240:135;;;;;;;;;;;;;;;;;;;7932:4;7938:5;7945:2;7949:6;7957:12;7971:7;7980:5;7892:94;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;7892:94:0;;;7869:127;;;;;;7846:150;;8035:4;8030:10;;8047:4;8042:10;;8054:15;;8071:12;8013:71;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;8013:71:0;;;8006:78;;;7596:495;;;;;;;;;:::o;4917:170::-;5071:9;5035:10;:16;5046:4;5035:16;;;;;;;;;;;;;;;:26;5052:8;5035:26;;;;;;;;;;;;;;;:33;5062:5;5035:33;;;;;;;;;;;;;;;:45;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4917:170;;;;:::o;8469:444::-;8609:14;8626:45;8643:9;8654:16;8626;:45::i;:::-;8609:62;;8722:6;8702:26;;:16;:26;;;:89;;;;;8785:6;8732:59;;:9;:24;8750:4;8732:24;;;;;;;;;;;;;;;:40;8764:6;8732:40;;;;;;;;;;;;;;;:49;;;;;;;;;;;;:59;;;8702:89;8681:225;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8469:444;;;;;:::o;10844:569::-;10968:1;10951:19;;:5;:19;;;10947:460;;;11051:4;:30;;;11082:2;11086:6;11098:19;11051:67;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;11051:67:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;11051:67:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;11051:67:0;;;;;;;;;;;;;;;;11043:112;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;10947:460;;;11186:17;11259:2;11263:6;11206:64;;;;;;;;;;;;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;11206:64:0;;;;;;;38:4:-1;29:7;25:18;67:10;61:17;96:58;199:8;192:4;186;182:15;179:29;167:10;160:49;0:215;;;11206:64:0;11186:84;;11292:4;:30;;;11323:5;11330:1;11333:4;11339:19;11292:67;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;11292:67:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;11292:67:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;11292:67:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;11292:67:0;;;;;;;;;;;;;;;;11284:112;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;10947:460;;10844:569;;;;:::o;8919:1919::-;9022:13;9138:1;9118:9;:16;:21;9114:44;;;9148:10;9141:17;;;;9114:44;9263:2;9243:9;:16;:22;;9235:58;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;9303:7;9320:9;9339;9370:28;9385:9;9396:1;9370:14;:28::i;:::-;9358:40;;;;;;;;;;;;9470:1;9465;:6;;;9461:1371;;;9606:1;9598:10;;9582:27;;9623:30;9941:4;9937:1;9926:9;9922:17;9918:28;9897:49;;181:10:16;10082:19:0;;9998:103;;;10018:5;9998:43;;;10042:16;10060:17;9998:80;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;9998:80:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;9998:80:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;9998:80:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;9998:80:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;9998:80:0;;;;;;;;;;;;;;;;:103;;;;9973:199;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;9461:1371;;;;10198:1;10193;:6;;;10189:643;;;10341:10;10333:18;;10189:643;;;10376:2;10372:1;:6;;;10368:464;;;10550:116;10633:16;10623:27;;;;;;10570:81;;;;;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;10570:81:0;;;10560:92;;;;;;10658:1;10654;:5;10661:1;10664;10550:116;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;10550:116:0;;;;;;;;10542:124;;10368:464;;;10774:47;10794:16;10784:27;;;;;;10813:1;10816;10819;10774:47;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;10774:47:0;;;;;;;;10766:55;;10368:464;10189:643;9461:1371;8919:1919;;;;;;;;:::o;1223:921:14:-;1332:7;1341:9;1352;1652:3;1646:4;1642:14;1714:4;1700:12;1696:23;1684:10;1680:40;1674:47;1669:52;;1779:4;1765:12;1761:23;1749:10;1745:40;1739:47;1734:52;;2123:4;2114;2100:12;2096:23;2084:10;2080:40;2074:47;2070:58;2065:63;;1608:530;;;;;;:::o;769:13528:0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;29:2:-1;21:6;17:15;117:4;105:10;97:6;88:34;148:4;140:6;136:17;126:27;;0:157;769:13528:0;;;;:::o", + "source": "pragma solidity >=0.5.0 <0.7.0;\n\nimport \"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\";\nimport \"@gnosis.pm/safe-contracts/contracts/common/SignatureDecoder.sol\";\nimport \"@gnosis.pm/safe-contracts/contracts/interfaces/ISignatureValidator.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, ISignatureValidatorConstants {\n\n string public constant NAME = \"Allowance Module\";\n string public constant VERSION = \"0.1.0\";\n\n //keccak256(\n // \"EIP712Domain(address verifyingContract)\"\n //);\n bytes32 public constant DOMAIN_SEPARATOR_TYPEHASH = 0x035aff83d86937d35b32e04f0ddc6ff469290eef2f1b692d8a815c89404d4749;\n\n // TODO: Fix hardcode hash\n bytes32 public constant ALLOWANCE_TRANSFER_TYPEHASH = 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 mapping(address => mapping (address => address[])) public tokens;\n mapping(address => mapping (uint48 => Delegate)) public delegates;\n mapping(address => uint48) public delegatesStart;\n bytes32 public domainSeparator;\n\n struct Delegate {\n address delegate;\n uint48 prev;\n uint48 next;\n }\n\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 SetAllowance(address indexed safe, address delegate, address token, uint96 allowanceAmount, uint16 resetTime);\n\n constructor() public {\n // TODO: add chain id\n domainSeparator = keccak256(abi.encode(DOMAIN_SEPARATOR_TYPEHASH, this));\n }\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(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(now / 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(now / 60);\n if (allowance.resetTimeMin > 0 && allowance.lastResetMin <= currentMin - allowance.resetTimeMin) {\n allowance.spent = 0;\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 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 }\n\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 (this contains a potential call -> EIP-1271)\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 }\n // Transfer token\n transfer(safe, token, to, amount);\n emit ExecuteAllowanceTransfer(address(safe), delegate, token, to, amount, allowance.nonce - 1);\n }\n\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 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 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 {\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 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 not too short\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 // When handling contract signatures the address of the contract is encoded into r\n owner = address(uint256(r));\n bytes memory contractSignature;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n // The signature data for contract signatures is appended to the concatenated signatures and the offset is stored in s\n contractSignature := add(add(signature, s), 0x20)\n }\n require(\n ISignatureValidator(owner).isValidSignature(transferHashData, contractSignature) == EIP1271_MAGIC_VALUE,\n \"Could not validate EIP-1271 signature\"\n );\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 }\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 function addDelegate(address delegate) public {\n require(delegate != address(0), \"Invalid delegate address\");\n uint48 index = uint48(delegate);\n // Delegate already exists, nothing to do\n if(delegates[msg.sender][index].delegate != address(0)) return;\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 function removeDelegate(address delegate) 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 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 }\n delegates[msg.sender][current.prev].next = current.next;\n delegates[msg.sender][current.next].prev = current.prev;\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": [ + 1224 + ], + "GnosisSafe": [ + 18 + ] + }, + "id": 1225, + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 1, + "literals": [ + "solidity", + ">=", + "0.5", + ".0", + "<", + "0.7", + ".0" + ], + "nodeType": "PragmaDirective", + "src": "0:31:0" + }, + { + "absolutePath": "@gnosis.pm/safe-contracts/contracts/common/Enum.sol", + "file": "@gnosis.pm/safe-contracts/contracts/common/Enum.sol", + "id": 2, + "nodeType": "ImportDirective", + "scope": 1225, + "sourceUnit": 3236, + "src": "33:61:0", + "symbolAliases": [], + "unitAlias": "" + }, + { + "absolutePath": "@gnosis.pm/safe-contracts/contracts/common/SignatureDecoder.sol", + "file": "@gnosis.pm/safe-contracts/contracts/common/SignatureDecoder.sol", + "id": 3, + "nodeType": "ImportDirective", + "scope": 1225, + "sourceUnit": 3371, + "src": "95:73:0", + "symbolAliases": [], + "unitAlias": "" + }, + { + "absolutePath": "@gnosis.pm/safe-contracts/contracts/interfaces/ISignatureValidator.sol", + "file": "@gnosis.pm/safe-contracts/contracts/interfaces/ISignatureValidator.sol", + "id": 4, + "nodeType": "ImportDirective", + "scope": 1225, + "sourceUnit": 3517, + "src": "169:80:0", + "symbolAliases": [], + "unitAlias": "" + }, + { + "baseContracts": [], + "contractDependencies": [], + "contractKind": "interface", + "documentation": null, + "fullyImplemented": false, + "id": 18, + "linearizedBaseContracts": [ + 18 + ], + "name": "GnosisSafe", + "nodeType": "ContractDefinition", + "nodes": [ + { + "body": null, + "documentation": "@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.", + "id": 17, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "execTransactionFromModule", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 13, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 6, + "name": "to", + "nodeType": "VariableDeclaration", + "scope": 17, + "src": "643:10:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 5, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "643:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 8, + "name": "value", + "nodeType": "VariableDeclaration", + "scope": 17, + "src": "655:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 7, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "655:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 10, + "name": "data", + "nodeType": "VariableDeclaration", + "scope": 17, + "src": "670:19:0", + "stateVariable": false, + "storageLocation": "calldata", + "typeDescriptions": { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 9, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "670:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 12, + "name": "operation", + "nodeType": "VariableDeclaration", + "scope": 17, + "src": "691:24:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Operation_$3234", + "typeString": "enum Enum.Operation" + }, + "typeName": { + "contractScope": null, + "id": 11, + "name": "Enum.Operation", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 3234, + "src": "691:14:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Operation_$3234", + "typeString": "enum Enum.Operation" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "642:74:0" + }, + "returnParameters": { + "id": 16, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15, + "name": "success", + "nodeType": "VariableDeclaration", + "scope": 17, + "src": "751:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 14, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "751:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "750:14:0" + }, + "scope": 18, + "src": "608:157:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + } + ], + "scope": 1225, + "src": "251:516:0" + }, + { + "baseContracts": [ + { + "arguments": null, + "baseName": { + "contractScope": null, + "id": 19, + "name": "SignatureDecoder", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 3370, + "src": "797:16:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_SignatureDecoder_$3370", + "typeString": "contract SignatureDecoder" + } + }, + "id": 20, + "nodeType": "InheritanceSpecifier", + "src": "797:16:0" + }, + { + "arguments": null, + "baseName": { + "contractScope": null, + "id": 21, + "name": "ISignatureValidatorConstants", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 3504, + "src": "815:28:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_ISignatureValidatorConstants_$3504", + "typeString": "contract ISignatureValidatorConstants" + } + }, + "id": 22, + "nodeType": "InheritanceSpecifier", + "src": "815:28:0" + } + ], + "contractDependencies": [ + 3370, + 3504 + ], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "id": 1224, + "linearizedBaseContracts": [ + 1224, + 3504, + 3370 + ], + "name": "AllowanceModule", + "nodeType": "ContractDefinition", + "nodes": [ + { + "constant": true, + "id": 25, + "name": "NAME", + "nodeType": "VariableDeclaration", + "scope": 1224, + "src": "851:48:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_string_memory", + "typeString": "string" + }, + "typeName": { + "id": 23, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "851:6:0", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "value": { + "argumentTypes": null, + "hexValue": "416c6c6f77616e6365204d6f64756c65", + "id": 24, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "881:18:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_08f58094bad74d8c1150a9739fed54fd2f5fa3e2ab1381a21213c5b33d83bad3", + "typeString": "literal_string \"Allowance Module\"" + }, + "value": "Allowance Module" + }, + "visibility": "public" + }, + { + "constant": true, + "id": 28, + "name": "VERSION", + "nodeType": "VariableDeclaration", + "scope": 1224, + "src": "905:40:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_string_memory", + "typeString": "string" + }, + "typeName": { + "id": 26, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "905:6:0", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "value": { + "argumentTypes": null, + "hexValue": "302e312e30", + "id": 27, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "938:7:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_aa7cdbe2cce2ec7b606b0e199ddd9b264a6e645e767fb8479a7917dcd1b8693f", + "typeString": "literal_string \"0.1.0\"" + }, + "value": "0.1.0" + }, + "visibility": "public" + }, + { + "constant": true, + "id": 31, + "name": "DOMAIN_SEPARATOR_TYPEHASH", + "nodeType": "VariableDeclaration", + "scope": 1224, + "src": "1030:118:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 29, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1030:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": { + "argumentTypes": null, + "hexValue": "307830333561666638336438363933376433356233326530346630646463366666343639323930656566326631623639326438613831356338393430346434373439", + "id": 30, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1082:66:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1517718281442037948617199096126532355110765202990829672390711201829802035017_by_1", + "typeString": "int_const 1517...(68 digits omitted)...5017" + }, + "value": "0x035aff83d86937d35b32e04f0ddc6ff469290eef2f1b692d8a815c89404d4749" + }, + "visibility": "public" + }, + { + "constant": true, + "id": 36, + "name": "ALLOWANCE_TRANSFER_TYPEHASH", + "nodeType": "VariableDeclaration", + "scope": 1224, + "src": "1186:189:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 32, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1186:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "hexValue": "416c6c6f77616e63655472616e73666572286164647265737320736166652c6164647265737320746f6b656e2c75696e74393620616d6f756e742c61646472657373207061796d656e74546f6b656e2c75696e743936207061796d656e742c75696e743136206e6f6e636529", + "id": 34, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1259:110:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_80b006280932094e7cc965863eb5118dc07e5d272c6670c4a7c87299e04fceeb", + "typeString": "literal_string \"AllowanceTransfer(address safe,address token,uint96 amount,address paymentToken,uint96 payment,uint16 nonce)\"" + }, + "value": "AllowanceTransfer(address safe,address token,uint96 amount,address paymentToken,uint96 payment,uint16 nonce)" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_stringliteral_80b006280932094e7cc965863eb5118dc07e5d272c6670c4a7c87299e04fceeb", + "typeString": "literal_string \"AllowanceTransfer(address safe,address token,uint96 amount,address paymentToken,uint96 payment,uint16 nonce)\"" + } + ], + "id": 33, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4971, + "src": "1240:9:0", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 35, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1240:135:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "public" + }, + { + "constant": false, + "id": 44, + "name": "allowances", + "nodeType": "VariableDeclaration", + "scope": 1224, + "src": "1419:88:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_mapping$_t_address_$_t_struct$_Allowance_$81_storage_$_$_$", + "typeString": "mapping(address => mapping(address => mapping(address => struct AllowanceModule.Allowance)))" + }, + "typeName": { + "id": 43, + "keyType": { + "id": 37, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1427:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "1419:70:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_mapping$_t_address_$_t_struct$_Allowance_$81_storage_$_$_$", + "typeString": "mapping(address => mapping(address => mapping(address => struct AllowanceModule.Allowance)))" + }, + "valueType": { + "id": 42, + "keyType": { + "id": 38, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1447:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "1438:50:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_struct$_Allowance_$81_storage_$_$", + "typeString": "mapping(address => mapping(address => struct AllowanceModule.Allowance))" + }, + "valueType": { + "id": 41, + "keyType": { + "id": 39, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1466:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "1458:29:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Allowance_$81_storage_$", + "typeString": "mapping(address => struct AllowanceModule.Allowance)" + }, + "valueType": { + "contractScope": null, + "id": 40, + "name": "Allowance", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 81, + "src": "1477:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_storage_ptr", + "typeString": "struct AllowanceModule.Allowance" + } + } + } + } + }, + "value": null, + "visibility": "public" + }, + { + "constant": false, + "id": 51, + "name": "tokens", + "nodeType": "VariableDeclaration", + "scope": 1224, + "src": "1513: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": 50, + "keyType": { + "id": 45, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1521:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "1513: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": 49, + "keyType": { + "id": 46, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1541:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "1532:30:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_array$_t_address_$dyn_storage_$", + "typeString": "mapping(address => address[])" + }, + "valueType": { + "baseType": { + "id": 47, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1552:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 48, + "length": null, + "nodeType": "ArrayTypeName", + "src": "1552:9:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + } + } + } + }, + "value": null, + "visibility": "public" + }, + { + "constant": false, + "id": 57, + "name": "delegates", + "nodeType": "VariableDeclaration", + "scope": 1224, + "src": "1583:65:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_uint48_$_t_struct$_Delegate_$70_storage_$_$", + "typeString": "mapping(address => mapping(uint48 => struct AllowanceModule.Delegate))" + }, + "typeName": { + "id": 56, + "keyType": { + "id": 52, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1591:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "1583:48:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_uint48_$_t_struct$_Delegate_$70_storage_$_$", + "typeString": "mapping(address => mapping(uint48 => struct AllowanceModule.Delegate))" + }, + "valueType": { + "id": 55, + "keyType": { + "id": 53, + "name": "uint48", + "nodeType": "ElementaryTypeName", + "src": "1611:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "nodeType": "Mapping", + "src": "1602:28:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint48_$_t_struct$_Delegate_$70_storage_$", + "typeString": "mapping(uint48 => struct AllowanceModule.Delegate)" + }, + "valueType": { + "contractScope": null, + "id": 54, + "name": "Delegate", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 70, + "src": "1621:8:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$70_storage_ptr", + "typeString": "struct AllowanceModule.Delegate" + } + } + } + }, + "value": null, + "visibility": "public" + }, + { + "constant": false, + "id": 61, + "name": "delegatesStart", + "nodeType": "VariableDeclaration", + "scope": 1224, + "src": "1654:48:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint48_$", + "typeString": "mapping(address => uint48)" + }, + "typeName": { + "id": 60, + "keyType": { + "id": 58, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1662:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "1654:26:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint48_$", + "typeString": "mapping(address => uint48)" + }, + "valueType": { + "id": 59, + "name": "uint48", + "nodeType": "ElementaryTypeName", + "src": "1673:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + } + }, + "value": null, + "visibility": "public" + }, + { + "constant": false, + "id": 63, + "name": "domainSeparator", + "nodeType": "VariableDeclaration", + "scope": 1224, + "src": "1708:30:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 62, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1708:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "public" + }, + { + "canonicalName": "AllowanceModule.Delegate", + "id": 70, + "members": [ + { + "constant": false, + "id": 65, + "name": "delegate", + "nodeType": "VariableDeclaration", + "scope": 70, + "src": "1771:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 64, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1771:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 67, + "name": "prev", + "nodeType": "VariableDeclaration", + "scope": 70, + "src": "1797:11:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + }, + "typeName": { + "id": 66, + "name": "uint48", + "nodeType": "ElementaryTypeName", + "src": "1797:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 69, + "name": "next", + "nodeType": "VariableDeclaration", + "scope": 70, + "src": "1818:11:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + }, + "typeName": { + "id": 68, + "name": "uint48", + "nodeType": "ElementaryTypeName", + "src": "1818:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "value": null, + "visibility": "internal" + } + ], + "name": "Delegate", + "nodeType": "StructDefinition", + "scope": 1224, + "src": "1745:91:0", + "visibility": "public" + }, + { + "canonicalName": "AllowanceModule.Allowance", + "id": 81, + "members": [ + { + "constant": false, + "id": 72, + "name": "amount", + "nodeType": "VariableDeclaration", + "scope": 81, + "src": "1869:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "typeName": { + "id": 71, + "name": "uint96", + "nodeType": "ElementaryTypeName", + "src": "1869:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 74, + "name": "spent", + "nodeType": "VariableDeclaration", + "scope": 81, + "src": "1892:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "typeName": { + "id": 73, + "name": "uint96", + "nodeType": "ElementaryTypeName", + "src": "1892:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 76, + "name": "resetTimeMin", + "nodeType": "VariableDeclaration", + "scope": 81, + "src": "1914:19:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + }, + "typeName": { + "id": 75, + "name": "uint16", + "nodeType": "ElementaryTypeName", + "src": "1914:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 78, + "name": "lastResetMin", + "nodeType": "VariableDeclaration", + "scope": 81, + "src": "1985:19:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 77, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "1985:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 80, + "name": "nonce", + "nodeType": "VariableDeclaration", + "scope": 81, + "src": "2014:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + }, + "typeName": { + "id": 79, + "name": "uint16", + "nodeType": "ElementaryTypeName", + "src": "2014:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "value": null, + "visibility": "internal" + } + ], + "name": "Allowance", + "nodeType": "StructDefinition", + "scope": 1224, + "src": "1842:191:0", + "visibility": "public" + }, + { + "anonymous": false, + "documentation": null, + "id": 87, + "name": "AddDelegate", + "nodeType": "EventDefinition", + "parameters": { + "id": 86, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 83, + "indexed": true, + "name": "safe", + "nodeType": "VariableDeclaration", + "scope": 87, + "src": "2057:20:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 82, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2057:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 85, + "indexed": false, + "name": "delegate", + "nodeType": "VariableDeclaration", + "scope": 87, + "src": "2079:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 84, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2079:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "2056:40:0" + }, + "src": "2039:58:0" + }, + { + "anonymous": false, + "documentation": null, + "id": 93, + "name": "RemoveDelegate", + "nodeType": "EventDefinition", + "parameters": { + "id": 92, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 89, + "indexed": true, + "name": "safe", + "nodeType": "VariableDeclaration", + "scope": 93, + "src": "2123:20:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 88, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2123:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 91, + "indexed": false, + "name": "delegate", + "nodeType": "VariableDeclaration", + "scope": 93, + "src": "2145:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 90, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2145:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "2122:40:0" + }, + "src": "2102:61:0" + }, + { + "anonymous": false, + "documentation": null, + "id": 107, + "name": "ExecuteAllowanceTransfer", + "nodeType": "EventDefinition", + "parameters": { + "id": 106, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 95, + "indexed": true, + "name": "safe", + "nodeType": "VariableDeclaration", + "scope": 107, + "src": "2199:20:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 94, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2199:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 97, + "indexed": false, + "name": "delegate", + "nodeType": "VariableDeclaration", + "scope": 107, + "src": "2221:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 96, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2221:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 99, + "indexed": false, + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 107, + "src": "2239:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 98, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2239:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 101, + "indexed": false, + "name": "to", + "nodeType": "VariableDeclaration", + "scope": 107, + "src": "2254:10:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 100, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2254:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 103, + "indexed": false, + "name": "value", + "nodeType": "VariableDeclaration", + "scope": 107, + "src": "2266:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "typeName": { + "id": 102, + "name": "uint96", + "nodeType": "ElementaryTypeName", + "src": "2266:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 105, + "indexed": false, + "name": "nonce", + "nodeType": "VariableDeclaration", + "scope": 107, + "src": "2280:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + }, + "typeName": { + "id": 104, + "name": "uint16", + "nodeType": "ElementaryTypeName", + "src": "2280:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "2198:95:0" + }, + "src": "2168:126:0" + }, + { + "anonymous": false, + "documentation": null, + "id": 119, + "name": "SetAllowance", + "nodeType": "EventDefinition", + "parameters": { + "id": 118, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 109, + "indexed": true, + "name": "safe", + "nodeType": "VariableDeclaration", + "scope": 119, + "src": "2318:20:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 108, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2318:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 111, + "indexed": false, + "name": "delegate", + "nodeType": "VariableDeclaration", + "scope": 119, + "src": "2340:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 110, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2340:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 113, + "indexed": false, + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 119, + "src": "2358:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 112, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2358:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 115, + "indexed": false, + "name": "allowanceAmount", + "nodeType": "VariableDeclaration", + "scope": 119, + "src": "2373:22:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "typeName": { + "id": 114, + "name": "uint96", + "nodeType": "ElementaryTypeName", + "src": "2373:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 117, + "indexed": false, + "name": "resetTime", + "nodeType": "VariableDeclaration", + "scope": 119, + "src": "2397:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + }, + "typeName": { + "id": 116, + "name": "uint16", + "nodeType": "ElementaryTypeName", + "src": "2397:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "2317:97:0" + }, + "src": "2299:116:0" + }, + { + "body": { + "id": 132, + "nodeType": "Block", + "src": "2442:119:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 130, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 122, + "name": "domainSeparator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 63, + "src": "2482:15:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 126, + "name": "DOMAIN_SEPARATOR_TYPEHASH", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 31, + "src": "2521:25:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "argumentTypes": null, + "id": 127, + "name": "this", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5001, + "src": "2548:4:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_AllowanceModule_$1224", + "typeString": "contract AllowanceModule" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_contract$_AllowanceModule_$1224", + "typeString": "contract AllowanceModule" + } + ], + "expression": { + "argumentTypes": null, + "id": 124, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4964, + "src": "2510:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 125, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encode", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2510:10:0", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencode_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 128, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2510:43:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 123, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4971, + "src": "2500:9:0", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 129, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2500:54:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "src": "2482:72:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "id": 131, + "nodeType": "ExpressionStatement", + "src": "2482:72:0" + } + ] + }, + "documentation": null, + "id": 133, + "implemented": true, + "kind": "constructor", + "modifiers": [], + "name": "", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 120, + "nodeType": "ParameterList", + "parameters": [], + "src": "2432:2:0" + }, + "returnParameters": { + "id": 121, + "nodeType": "ParameterList", + "parameters": [], + "src": "2442:0:0" + }, + "scope": 1224, + "src": "2421:140:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 267, + "nodeType": "Block", + "src": "3153:1171:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 157, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 147, + "name": "delegates", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 57, + "src": "3171:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_uint48_$_t_struct$_Delegate_$70_storage_$_$", + "typeString": "mapping(address => mapping(uint48 => struct AllowanceModule.Delegate storage ref))" + } + }, + "id": 150, + "indexExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 148, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4977, + "src": "3181:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 149, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3181:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3171:21:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint48_$_t_struct$_Delegate_$70_storage_$", + "typeString": "mapping(uint48 => struct AllowanceModule.Delegate storage ref)" + } + }, + "id": 154, + "indexExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 152, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 135, + "src": "3200:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 151, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "3193:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint48_$", + "typeString": "type(uint48)" + }, + "typeName": "uint48" + }, + "id": 153, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3193:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3171:39:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$70_storage", + "typeString": "struct AllowanceModule.Delegate storage ref" + } + }, + "id": 155, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "delegate", + "nodeType": "MemberAccess", + "referencedDeclaration": 65, + "src": "3171:48:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "id": 156, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 135, + "src": "3223:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "3171:60:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "64656c6567617465735b6d73672e73656e6465725d5b75696e7434382864656c6567617465295d2e64656c6567617465203d3d2064656c6567617465", + "id": 158, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3233:62:0", + "subdenomination": null, + "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": 146, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 4980, + 4981 + ], + "referencedDeclaration": 4981, + "src": "3163:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 159, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3163:133:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 160, + "nodeType": "ExpressionStatement", + "src": "3163:133:0" + }, + { + "assignments": [ + 162 + ], + "declarations": [ + { + "constant": false, + "id": 162, + "name": "allowance", + "nodeType": "VariableDeclaration", + "scope": 267, + "src": "3306:26:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance" + }, + "typeName": { + "contractScope": null, + "id": 161, + "name": "Allowance", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 81, + "src": "3306:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_storage_ptr", + "typeString": "struct AllowanceModule.Allowance" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 169, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 164, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4977, + "src": "3348:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 165, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3348:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 166, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 135, + "src": "3360:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 167, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 137, + "src": "3370: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": 163, + "name": "getAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 336, + "src": "3335:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_address_$_t_address_$_t_address_$returns$_t_struct$_Allowance_$81_memory_ptr_$", + "typeString": "function (address,address,address) view returns (struct AllowanceModule.Allowance memory)" + } + }, + "id": 168, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3335:41:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "3306:70:0" + }, + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + }, + "id": 173, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 170, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 162, + "src": "3390:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 171, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "nonce", + "nodeType": "MemberAccess", + "referencedDeclaration": 80, + "src": "3390:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 172, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3409:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "3390:20:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 191, + "nodeType": "IfStatement", + "src": "3386:210:0", + "trueBody": { + "id": 190, + "nodeType": "Block", + "src": "3412:184:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 178, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 174, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 162, + "src": "3512:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 176, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "nonce", + "nodeType": "MemberAccess", + "referencedDeclaration": 80, + "src": "3512:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "31", + "id": 177, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3530:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "3512:19:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "id": 179, + "nodeType": "ExpressionStatement", + "src": "3512:19:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 187, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 137, + "src": "3579:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 180, + "name": "tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 51, + "src": "3545: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": 184, + "indexExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 181, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4977, + "src": "3552:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 182, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3552:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3545:18:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_array$_t_address_$dyn_storage_$", + "typeString": "mapping(address => address[] storage ref)" + } + }, + "id": 185, + "indexExpression": { + "argumentTypes": null, + "id": 183, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 135, + "src": "3564:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3545:28:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 186, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "push", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3545:33:0", + "typeDescriptions": { + "typeIdentifier": "t_function_arraypush_nonpayable$_t_address_$returns$_t_uint256_$", + "typeString": "function (address) returns (uint256)" + } + }, + "id": 188, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3545:40:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 189, + "nodeType": "ExpressionStatement", + "src": "3545:40:0" + } + ] + } + }, + { + "assignments": [ + 193 + ], + "declarations": [ + { + "constant": false, + "id": 193, + "name": "currentMin", + "nodeType": "VariableDeclaration", + "scope": 267, + "src": "3722:17:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 192, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "3722:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 199, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 197, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 195, + "name": "now", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4979, + "src": "3749:3:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "/", + "rightExpression": { + "argumentTypes": null, + "hexValue": "3630", + "id": 196, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3755:2:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_60_by_1", + "typeString": "int_const 60" + }, + "value": "60" + }, + "src": "3749:8:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 194, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "3742:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint32_$", + "typeString": "type(uint32)" + }, + "typeName": "uint32" + }, + "id": 198, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3742:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "3722:36:0" + }, + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "id": 202, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 200, + "name": "resetBaseMin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 143, + "src": "3772:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 201, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3787:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "3772:16:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "id": 228, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 225, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 162, + "src": "3986:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 226, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "lastResetMin", + "nodeType": "MemberAccess", + "referencedDeclaration": 78, + "src": "3986:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 227, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4012:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "3986:27:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 236, + "nodeType": "IfStatement", + "src": "3982:93:0", + "trueBody": { + "id": 235, + "nodeType": "Block", + "src": "4015:60:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 233, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 229, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 162, + "src": "4029:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 231, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "lastResetMin", + "nodeType": "MemberAccess", + "referencedDeclaration": 78, + "src": "4029:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 232, + "name": "currentMin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 193, + "src": "4054:10:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "src": "4029:35:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "id": 234, + "nodeType": "ExpressionStatement", + "src": "4029:35:0" + } + ] + } + }, + "id": 237, + "nodeType": "IfStatement", + "src": "3768:307:0", + "trueBody": { + "id": 224, + "nodeType": "Block", + "src": "3790:186:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "id": 206, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 204, + "name": "resetBaseMin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 143, + "src": "3812:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "id": 205, + "name": "currentMin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 193, + "src": "3828:10:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "src": "3812:26:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "7265736574426173654d696e203c3d2063757272656e744d696e", + "id": 207, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3840:28:0", + "subdenomination": null, + "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": 203, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 4980, + 4981 + ], + "referencedDeclaration": 4981, + "src": "3804:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 208, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3804:65:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 209, + "nodeType": "ExpressionStatement", + "src": "3804:65:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 222, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 210, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 162, + "src": "3883:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 212, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "lastResetMin", + "nodeType": "MemberAccess", + "referencedDeclaration": 78, + "src": "3883:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "id": 221, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 213, + "name": "currentMin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 193, + "src": "3908:10:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "argumentTypes": null, + "components": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "id": 219, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "components": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "id": 216, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 214, + "name": "currentMin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 193, + "src": "3923:10:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "argumentTypes": null, + "id": 215, + "name": "resetBaseMin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 143, + "src": "3936:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "src": "3923:25:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + } + ], + "id": 217, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "3922:27:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "BinaryOperation", + "operator": "%", + "rightExpression": { + "argumentTypes": null, + "id": 218, + "name": "resetTimeMin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 141, + "src": "3952:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "src": "3922:42:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + } + ], + "id": 220, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "3921:44:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "src": "3908:57:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "src": "3883:82:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "id": 223, + "nodeType": "ExpressionStatement", + "src": "3883:82:0" + } + ] + } + }, + { + "expression": { + "argumentTypes": null, + "id": 242, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 238, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 162, + "src": "4084:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 240, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "resetTimeMin", + "nodeType": "MemberAccess", + "referencedDeclaration": 76, + "src": "4084:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 241, + "name": "resetTimeMin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 141, + "src": "4109:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "src": "4084:37:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "id": 243, + "nodeType": "ExpressionStatement", + "src": "4084:37:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 248, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 244, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 162, + "src": "4131:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 246, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "amount", + "nodeType": "MemberAccess", + "referencedDeclaration": 72, + "src": "4131:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 247, + "name": "allowanceAmount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 139, + "src": "4150:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "src": "4131:34:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "id": 249, + "nodeType": "ExpressionStatement", + "src": "4131:34:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 251, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4977, + "src": "4191:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 252, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "4191:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 253, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 135, + "src": "4203:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 254, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 137, + "src": "4213:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 255, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 162, + "src": "4220:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_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_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + ], + "id": 250, + "name": "updateAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 358, + "src": "4175:15:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_address_$_t_struct$_Allowance_$81_memory_ptr_$returns$__$", + "typeString": "function (address,address,address,struct AllowanceModule.Allowance memory)" + } + }, + "id": 256, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4175:55:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 257, + "nodeType": "ExpressionStatement", + "src": "4175:55:0" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 259, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4977, + "src": "4258:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 260, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "4258:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 261, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 135, + "src": "4270:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 262, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 137, + "src": "4280:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 263, + "name": "allowanceAmount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 139, + "src": "4287:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + { + "argumentTypes": null, + "id": 264, + "name": "resetTimeMin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 141, + "src": "4304: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": 258, + "name": "SetAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 119, + "src": "4245: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": 265, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4245:72:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 266, + "nodeType": "EmitStatement", + "src": "4240:77:0" + } + ] + }, + "documentation": "@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", + "id": 268, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "setAllowance", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 144, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 135, + "name": "delegate", + "nodeType": "VariableDeclaration", + "scope": 268, + "src": "3035:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 134, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3035:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 137, + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 268, + "src": "3053:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 136, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3053:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 139, + "name": "allowanceAmount", + "nodeType": "VariableDeclaration", + "scope": 268, + "src": "3068:22:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "typeName": { + "id": 138, + "name": "uint96", + "nodeType": "ElementaryTypeName", + "src": "3068:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 141, + "name": "resetTimeMin", + "nodeType": "VariableDeclaration", + "scope": 268, + "src": "3092:19:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + }, + "typeName": { + "id": 140, + "name": "uint16", + "nodeType": "ElementaryTypeName", + "src": "3092:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 143, + "name": "resetBaseMin", + "nodeType": "VariableDeclaration", + "scope": 268, + "src": "3113:19:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 142, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "3113:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "3034:99:0" + }, + "returnParameters": { + "id": 145, + "nodeType": "ParameterList", + "parameters": [], + "src": "3153:0:0" + }, + "scope": 1224, + "src": "3013:1311:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 335, + "nodeType": "Block", + "src": "4449:462:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 287, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 279, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 277, + "src": "4459:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 280, + "name": "allowances", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 44, + "src": "4471:10:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_mapping$_t_address_$_t_struct$_Allowance_$81_storage_$_$_$", + "typeString": "mapping(address => mapping(address => mapping(address => struct AllowanceModule.Allowance storage ref)))" + } + }, + "id": 282, + "indexExpression": { + "argumentTypes": null, + "id": 281, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 270, + "src": "4482:4:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "4471:16:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_struct$_Allowance_$81_storage_$_$", + "typeString": "mapping(address => mapping(address => struct AllowanceModule.Allowance storage ref))" + } + }, + "id": 284, + "indexExpression": { + "argumentTypes": null, + "id": 283, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 272, + "src": "4488:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "4471:26:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Allowance_$81_storage_$", + "typeString": "mapping(address => struct AllowanceModule.Allowance storage ref)" + } + }, + "id": 286, + "indexExpression": { + "argumentTypes": null, + "id": 285, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 274, + "src": "4498:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "4471:33:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_storage", + "typeString": "struct AllowanceModule.Allowance storage ref" + } + }, + "src": "4459:45:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 288, + "nodeType": "ExpressionStatement", + "src": "4459:45:0" + }, + { + "assignments": [ + 290 + ], + "declarations": [ + { + "constant": false, + "id": 290, + "name": "currentMin", + "nodeType": "VariableDeclaration", + "scope": 335, + "src": "4576:17:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 289, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "4576:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 296, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 294, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 292, + "name": "now", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4979, + "src": "4603:3:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "/", + "rightExpression": { + "argumentTypes": null, + "hexValue": "3630", + "id": 293, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4609:2:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_60_by_1", + "typeString": "int_const 60" + }, + "value": "60" + }, + "src": "4603:8:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 291, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "4596:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint32_$", + "typeString": "type(uint32)" + }, + "typeName": "uint32" + }, + "id": 295, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4596:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "4576:36:0" + }, + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 308, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + }, + "id": 300, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 297, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 277, + "src": "4626:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 298, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "resetTimeMin", + "nodeType": "MemberAccess", + "referencedDeclaration": 76, + "src": "4626:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 299, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4651:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "4626:26:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "&&", + "rightExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "id": 307, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 301, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 277, + "src": "4656:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 302, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "lastResetMin", + "nodeType": "MemberAccess", + "referencedDeclaration": 78, + "src": "4656:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "id": 306, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 303, + "name": "currentMin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 290, + "src": "4682:10:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 304, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 277, + "src": "4695:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 305, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "resetTimeMin", + "nodeType": "MemberAccess", + "referencedDeclaration": 76, + "src": "4695:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "src": "4682:35:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "src": "4656:61:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "4626:91:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 332, + "nodeType": "IfStatement", + "src": "4622:257:0", + "trueBody": { + "id": 331, + "nodeType": "Block", + "src": "4719:160:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 313, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 309, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 277, + "src": "4733:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 311, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "spent", + "nodeType": "MemberAccess", + "referencedDeclaration": 74, + "src": "4733:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "30", + "id": 312, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4751:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "4733:19:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "id": 314, + "nodeType": "ExpressionStatement", + "src": "4733:19:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 329, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 315, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 277, + "src": "4766:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 317, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "lastResetMin", + "nodeType": "MemberAccess", + "referencedDeclaration": 78, + "src": "4766:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "id": 328, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 318, + "name": "currentMin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 290, + "src": "4791:10:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "argumentTypes": null, + "components": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "id": 326, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "components": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "id": 322, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 319, + "name": "currentMin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 290, + "src": "4806:10:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 320, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 277, + "src": "4819:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 321, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "lastResetMin", + "nodeType": "MemberAccess", + "referencedDeclaration": 78, + "src": "4819:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "src": "4806:35:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + } + ], + "id": 323, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "4805:37:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "BinaryOperation", + "operator": "%", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 324, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 277, + "src": "4845:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 325, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "resetTimeMin", + "nodeType": "MemberAccess", + "referencedDeclaration": 76, + "src": "4845:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "src": "4805:62:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + } + ], + "id": 327, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "4804:64:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "src": "4791:77:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "src": "4766:102:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "id": 330, + "nodeType": "ExpressionStatement", + "src": "4766:102:0" + } + ] + } + }, + { + "expression": { + "argumentTypes": null, + "id": 333, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 277, + "src": "4895:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "functionReturnParameters": 278, + "id": 334, + "nodeType": "Return", + "src": "4888:16:0" + } + ] + }, + "documentation": null, + "id": 336, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getAllowance", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 275, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 270, + "name": "safe", + "nodeType": "VariableDeclaration", + "scope": 336, + "src": "4352:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 269, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4352:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 272, + "name": "delegate", + "nodeType": "VariableDeclaration", + "scope": 336, + "src": "4366:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 271, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4366:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 274, + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 336, + "src": "4384:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 273, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4384:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "4351:47:0" + }, + "returnParameters": { + "id": 278, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 277, + "name": "allowance", + "nodeType": "VariableDeclaration", + "scope": 336, + "src": "4421:26:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance" + }, + "typeName": { + "contractScope": null, + "id": 276, + "name": "Allowance", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 81, + "src": "4421:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_storage_ptr", + "typeString": "struct AllowanceModule.Allowance" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "4420:28:0" + }, + "scope": 1224, + "src": "4330:581:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "private" + }, + { + "body": { + "id": 357, + "nodeType": "Block", + "src": "5025:62:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 355, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 347, + "name": "allowances", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 44, + "src": "5035:10:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_mapping$_t_address_$_t_struct$_Allowance_$81_storage_$_$_$", + "typeString": "mapping(address => mapping(address => mapping(address => struct AllowanceModule.Allowance storage ref)))" + } + }, + "id": 351, + "indexExpression": { + "argumentTypes": null, + "id": 348, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 338, + "src": "5046:4:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "5035:16:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_struct$_Allowance_$81_storage_$_$", + "typeString": "mapping(address => mapping(address => struct AllowanceModule.Allowance storage ref))" + } + }, + "id": 352, + "indexExpression": { + "argumentTypes": null, + "id": 349, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 340, + "src": "5052:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "5035:26:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Allowance_$81_storage_$", + "typeString": "mapping(address => struct AllowanceModule.Allowance storage ref)" + } + }, + "id": 353, + "indexExpression": { + "argumentTypes": null, + "id": 350, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 342, + "src": "5062:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "5035:33:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_storage", + "typeString": "struct AllowanceModule.Allowance storage ref" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 354, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 344, + "src": "5071:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "src": "5035:45:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_storage", + "typeString": "struct AllowanceModule.Allowance storage ref" + } + }, + "id": 356, + "nodeType": "ExpressionStatement", + "src": "5035:45:0" + } + ] + }, + "documentation": null, + "id": 358, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "updateAllowance", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 345, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 338, + "name": "safe", + "nodeType": "VariableDeclaration", + "scope": 358, + "src": "4942:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 337, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4942:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 340, + "name": "delegate", + "nodeType": "VariableDeclaration", + "scope": 358, + "src": "4956:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 339, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4956:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 342, + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 358, + "src": "4974:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 341, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4974:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 344, + "name": "allowance", + "nodeType": "VariableDeclaration", + "scope": 358, + "src": "4989:26:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance" + }, + "typeName": { + "contractScope": null, + "id": 343, + "name": "Allowance", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 81, + "src": "4989:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_storage_ptr", + "typeString": "struct AllowanceModule.Allowance" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "4941:75:0" + }, + "returnParameters": { + "id": 346, + "nodeType": "ParameterList", + "parameters": [], + "src": "5025:0:0" + }, + "scope": 1224, + "src": "4917:170:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "private" + }, + { + "body": { + "id": 388, + "nodeType": "Block", + "src": "5157:181:0", + "statements": [ + { + "assignments": [ + 366 + ], + "declarations": [ + { + "constant": false, + "id": 366, + "name": "allowance", + "nodeType": "VariableDeclaration", + "scope": 388, + "src": "5167:26:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance" + }, + "typeName": { + "contractScope": null, + "id": 365, + "name": "Allowance", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 81, + "src": "5167:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_storage_ptr", + "typeString": "struct AllowanceModule.Allowance" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 373, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 368, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4977, + "src": "5209:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 369, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "5209:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 370, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 360, + "src": "5221:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 371, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 362, + "src": "5231: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": 367, + "name": "getAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 336, + "src": "5196:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_address_$_t_address_$_t_address_$returns$_t_struct$_Allowance_$81_memory_ptr_$", + "typeString": "function (address,address,address) view returns (struct AllowanceModule.Allowance memory)" + } + }, + "id": 372, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5196:41:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "5167:70:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 378, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 374, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 366, + "src": "5247:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 376, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "spent", + "nodeType": "MemberAccess", + "referencedDeclaration": 74, + "src": "5247:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "30", + "id": 377, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "5265:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "5247:19:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "id": 379, + "nodeType": "ExpressionStatement", + "src": "5247:19:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 381, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4977, + "src": "5292:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 382, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "5292:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 383, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 360, + "src": "5304:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 384, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 362, + "src": "5314:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 385, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 366, + "src": "5321:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_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_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + ], + "id": 380, + "name": "updateAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 358, + "src": "5276:15:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_address_$_t_struct$_Allowance_$81_memory_ptr_$returns$__$", + "typeString": "function (address,address,address,struct AllowanceModule.Allowance memory)" + } + }, + "id": 386, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5276:55:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 387, + "nodeType": "ExpressionStatement", + "src": "5276:55:0" + } + ] + }, + "documentation": null, + "id": 389, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "resetAllowance", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 363, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 360, + "name": "delegate", + "nodeType": "VariableDeclaration", + "scope": 389, + "src": "5117:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 359, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5117:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 362, + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 389, + "src": "5135:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 361, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5135:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5116:33:0" + }, + "returnParameters": { + "id": 364, + "nodeType": "ParameterList", + "parameters": [], + "src": "5157:0:0" + }, + "scope": 1224, + "src": "5093:245:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 577, + "nodeType": "Block", + "src": "5602:1988:0", + "statements": [ + { + "assignments": [ + 409 + ], + "declarations": [ + { + "constant": false, + "id": 409, + "name": "allowance", + "nodeType": "VariableDeclaration", + "scope": 577, + "src": "5641:26:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance" + }, + "typeName": { + "contractScope": null, + "id": 408, + "name": "Allowance", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 81, + "src": "5641:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_storage_ptr", + "typeString": "struct AllowanceModule.Allowance" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 417, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 412, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 391, + "src": "5691:4:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + ], + "id": 411, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "5683:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 413, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5683:13:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 414, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 403, + "src": "5698:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 415, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 393, + "src": "5708: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": 410, + "name": "getAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 336, + "src": "5670:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_address_$_t_address_$_t_address_$returns$_t_struct$_Allowance_$81_memory_ptr_$", + "typeString": "function (address,address,address) view returns (struct AllowanceModule.Allowance memory)" + } + }, + "id": 416, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5670:44:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "5641:73:0" + }, + { + "assignments": [ + 419 + ], + "declarations": [ + { + "constant": false, + "id": 419, + "name": "transferHashData", + "nodeType": "VariableDeclaration", + "scope": 577, + "src": "5724:29:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 418, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "5724:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 432, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 422, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 391, + "src": "5789:4:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + ], + "id": 421, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "5781:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 423, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5781:13:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 424, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 393, + "src": "5796:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 425, + "name": "to", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 395, + "src": "5803:2:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 426, + "name": "amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 397, + "src": "5807:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + { + "argumentTypes": null, + "id": 427, + "name": "paymentToken", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 399, + "src": "5815:12:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 428, + "name": "payment", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 401, + "src": "5829:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 429, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 409, + "src": "5838:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 430, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "nonce", + "nodeType": "MemberAccess", + "referencedDeclaration": 80, + "src": "5838: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": 420, + "name": "generateTransferHashData", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 626, + "src": "5756: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": 431, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5756:98:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "5724:130:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 440, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 433, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 409, + "src": "5897:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 435, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "nonce", + "nodeType": "MemberAccess", + "referencedDeclaration": 80, + "src": "5897:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + }, + "id": 439, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 436, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 409, + "src": "5915:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 437, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "nonce", + "nodeType": "MemberAccess", + "referencedDeclaration": 80, + "src": "5915:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 438, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "5933:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "5915:19:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "src": "5897:37:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "id": 441, + "nodeType": "ExpressionStatement", + "src": "5897:37:0" + }, + { + "assignments": [ + 443 + ], + "declarations": [ + { + "constant": false, + "id": 443, + "name": "newSpent", + "nodeType": "VariableDeclaration", + "scope": 577, + "src": "5944:15:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "typeName": { + "id": 442, + "name": "uint96", + "nodeType": "ElementaryTypeName", + "src": "5944:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 448, + "initialValue": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "id": 447, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 444, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 409, + "src": "5962:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 445, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "spent", + "nodeType": "MemberAccess", + "referencedDeclaration": 74, + "src": "5962:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "argumentTypes": null, + "id": 446, + "name": "amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 397, + "src": "5980:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "src": "5962:24:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "5944:42:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 458, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "id": 453, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 450, + "name": "newSpent", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 443, + "src": "6051:8:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 451, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 409, + "src": "6062:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 452, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "spent", + "nodeType": "MemberAccess", + "referencedDeclaration": 74, + "src": "6062:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "src": "6051:26:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "&&", + "rightExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "id": 457, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 454, + "name": "newSpent", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 443, + "src": "6081:8:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 455, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 409, + "src": "6093:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 456, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "amount", + "nodeType": "MemberAccess", + "referencedDeclaration": 72, + "src": "6093:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "src": "6081:28:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "6051:58:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "6e65775370656e74203e20616c6c6f77616e63652e7370656e74202626206e65775370656e74203c3d20616c6c6f77616e63652e616d6f756e74", + "id": 459, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6111:60:0", + "subdenomination": null, + "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": 449, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 4980, + 4981 + ], + "referencedDeclaration": 4981, + "src": "6043:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 460, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6043:129:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 461, + "nodeType": "ExpressionStatement", + "src": "6043:129:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 466, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 462, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 409, + "src": "6182:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 464, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "spent", + "nodeType": "MemberAccess", + "referencedDeclaration": 74, + "src": "6182:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 465, + "name": "newSpent", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 443, + "src": "6200:8:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "src": "6182:26:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "id": 467, + "nodeType": "ExpressionStatement", + "src": "6182:26:0" + }, + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "id": 470, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 468, + "name": "payment", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 401, + "src": "6222:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 469, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6232:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "6222:11:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 526, + "nodeType": "IfStatement", + "src": "6218:748:0", + "trueBody": { + "id": 525, + "nodeType": "Block", + "src": "6235:731:0", + "statements": [ + { + "assignments": [ + 472 + ], + "declarations": [ + { + "constant": false, + "id": 472, + "name": "paymentAllowance", + "nodeType": "VariableDeclaration", + "scope": 525, + "src": "6325:33:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance" + }, + "typeName": { + "contractScope": null, + "id": 471, + "name": "Allowance", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 81, + "src": "6325:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_storage_ptr", + "typeString": "struct AllowanceModule.Allowance" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 485, + "initialValue": { + "argumentTypes": null, + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 475, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 473, + "name": "paymentToken", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 399, + "src": "6361:12:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "id": 474, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 393, + "src": "6377:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "6361:21:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 479, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 391, + "src": "6418:4:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + ], + "id": 478, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "6410:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 480, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6410:13:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 481, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 403, + "src": "6425:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 482, + "name": "paymentToken", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 399, + "src": "6435: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": 477, + "name": "getAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 336, + "src": "6397:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_address_$_t_address_$_t_address_$returns$_t_struct$_Allowance_$81_memory_ptr_$", + "typeString": "function (address,address,address) view returns (struct AllowanceModule.Allowance memory)" + } + }, + "id": 483, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6397:51:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 484, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "Conditional", + "src": "6361:87:0", + "trueExpression": { + "argumentTypes": null, + "id": 476, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 409, + "src": "6385:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "6325:123:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 491, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 486, + "name": "newSpent", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 443, + "src": "6462:8:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "id": 490, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 487, + "name": "paymentAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 472, + "src": "6473:16:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 488, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "spent", + "nodeType": "MemberAccess", + "referencedDeclaration": 74, + "src": "6473:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "argumentTypes": null, + "id": 489, + "name": "payment", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 401, + "src": "6498:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "src": "6473:32:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "src": "6462:43:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "id": 492, + "nodeType": "ExpressionStatement", + "src": "6462:43:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 502, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "id": 497, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 494, + "name": "newSpent", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 443, + "src": "6578:8:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 495, + "name": "paymentAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 472, + "src": "6589:16:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 496, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "spent", + "nodeType": "MemberAccess", + "referencedDeclaration": 74, + "src": "6589:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "src": "6578:33:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "&&", + "rightExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "id": 501, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 498, + "name": "newSpent", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 443, + "src": "6615:8:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 499, + "name": "paymentAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 472, + "src": "6627:16:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 500, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "amount", + "nodeType": "MemberAccess", + "referencedDeclaration": 72, + "src": "6627:23:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "src": "6615:35:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "6578:72:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "6e65775370656e74203e207061796d656e74416c6c6f77616e63652e7370656e74202626206e65775370656e74203c3d207061796d656e74416c6c6f77616e63652e616d6f756e74", + "id": 503, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6652:74:0", + "subdenomination": null, + "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": 493, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 4980, + 4981 + ], + "referencedDeclaration": 4981, + "src": "6570:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 504, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6570:157:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 505, + "nodeType": "ExpressionStatement", + "src": "6570:157:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 510, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 506, + "name": "paymentAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 472, + "src": "6741:16:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 508, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "spent", + "nodeType": "MemberAccess", + "referencedDeclaration": 74, + "src": "6741:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 509, + "name": "newSpent", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 443, + "src": "6766:8:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "src": "6741:33:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "id": 511, + "nodeType": "ExpressionStatement", + "src": "6741:33:0" + }, + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 514, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 512, + "name": "paymentToken", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 399, + "src": "6860:12:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "argumentTypes": null, + "id": 513, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 393, + "src": "6876:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "6860:21:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 524, + "nodeType": "IfStatement", + "src": "6856:99:0", + "trueBody": { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 517, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 391, + "src": "6907:4:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + ], + "id": 516, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "6899:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 518, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6899:13:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 519, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 403, + "src": "6914:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 520, + "name": "paymentToken", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 399, + "src": "6924:12:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 521, + "name": "paymentAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 472, + "src": "6938:16:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_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_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + ], + "id": 515, + "name": "updateAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 358, + "src": "6883:15:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_address_$_t_struct$_Allowance_$81_memory_ptr_$returns$__$", + "typeString": "function (address,address,address,struct AllowanceModule.Allowance memory)" + } + }, + "id": 522, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6883:72:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 523, + "nodeType": "ExpressionStatement", + "src": "6883:72:0" + } + } + ] + } + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 529, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 391, + "src": "6999:4:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + ], + "id": 528, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "6991:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 530, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6991:13:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 531, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 403, + "src": "7006:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 532, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 393, + "src": "7016:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 533, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 409, + "src": "7023:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_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_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + ], + "id": 527, + "name": "updateAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 358, + "src": "6975:15:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_address_$_t_struct$_Allowance_$81_memory_ptr_$returns$__$", + "typeString": "function (address,address,address,struct AllowanceModule.Allowance memory)" + } + }, + "id": 534, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6975:58:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 535, + "nodeType": "ExpressionStatement", + "src": "6975:58:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 537, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 403, + "src": "7172:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 538, + "name": "signature", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 405, + "src": "7182:9:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + { + "argumentTypes": null, + "id": 539, + "name": "transferHashData", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 419, + "src": "7193:16:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + { + "argumentTypes": null, + "id": 540, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 391, + "src": "7211: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": 536, + "name": "checkSignature", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 697, + "src": "7157:14:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_bytes_memory_ptr_$_t_bytes_memory_ptr_$_t_contract$_GnosisSafe_$18_$returns$__$", + "typeString": "function (address,bytes memory,bytes memory,contract GnosisSafe)" + } + }, + "id": 541, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7157:59:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 542, + "nodeType": "ExpressionStatement", + "src": "7157:59:0" + }, + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "id": 545, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 543, + "name": "payment", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 401, + "src": "7231:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 544, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7241:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "7231:11:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 555, + "nodeType": "IfStatement", + "src": "7227:184:0", + "trueBody": { + "id": 554, + "nodeType": "Block", + "src": "7244:167:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 547, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 391, + "src": "7361:4:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + }, + { + "argumentTypes": null, + "id": 548, + "name": "paymentToken", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 399, + "src": "7367:12:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 549, + "name": "tx", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4989, + "src": "7381:2:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_transaction", + "typeString": "tx" + } + }, + "id": 550, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "origin", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "7381:9:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 551, + "name": "payment", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 401, + "src": "7392: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": 546, + "name": "transfer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 873, + "src": "7352: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": 552, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7352:48:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 553, + "nodeType": "ExpressionStatement", + "src": "7352:48:0" + } + ] + } + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 557, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 391, + "src": "7455:4:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + }, + { + "argumentTypes": null, + "id": 558, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 393, + "src": "7461:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 559, + "name": "to", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 395, + "src": "7468:2:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 560, + "name": "amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 397, + "src": "7472: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": 556, + "name": "transfer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 873, + "src": "7446: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": 561, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7446:33:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 562, + "nodeType": "ExpressionStatement", + "src": "7446:33:0" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 565, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 391, + "src": "7527:4:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + ], + "id": 564, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "7519:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 566, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7519:13:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 567, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 403, + "src": "7534:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 568, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 393, + "src": "7544:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 569, + "name": "to", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 395, + "src": "7551:2:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 570, + "name": "amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 397, + "src": "7555:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + }, + "id": 574, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 571, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 409, + "src": "7563:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 572, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "nonce", + "nodeType": "MemberAccess", + "referencedDeclaration": 80, + "src": "7563:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 573, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7581:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "7563: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": 563, + "name": "ExecuteAllowanceTransfer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 107, + "src": "7494: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": 575, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7494:89:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 576, + "nodeType": "EmitStatement", + "src": "7489:94:0" + } + ] + }, + "documentation": null, + "id": 578, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "executeAllowanceTransfer", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 406, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 391, + "name": "safe", + "nodeType": "VariableDeclaration", + "scope": 578, + "src": "5387:15:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + }, + "typeName": { + "contractScope": null, + "id": 390, + "name": "GnosisSafe", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 18, + "src": "5387:10:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 393, + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 578, + "src": "5412:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 392, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5412:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 395, + "name": "to", + "nodeType": "VariableDeclaration", + "scope": 578, + "src": "5435:18:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + "typeName": { + "id": 394, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5435:15:0", + "stateMutability": "payable", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 397, + "name": "amount", + "nodeType": "VariableDeclaration", + "scope": 578, + "src": "5463:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "typeName": { + "id": 396, + "name": "uint96", + "nodeType": "ElementaryTypeName", + "src": "5463:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 399, + "name": "paymentToken", + "nodeType": "VariableDeclaration", + "scope": 578, + "src": "5486:20:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 398, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5486:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 401, + "name": "payment", + "nodeType": "VariableDeclaration", + "scope": 578, + "src": "5516:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "typeName": { + "id": 400, + "name": "uint96", + "nodeType": "ElementaryTypeName", + "src": "5516:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 403, + "name": "delegate", + "nodeType": "VariableDeclaration", + "scope": 578, + "src": "5540:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 402, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5540:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 405, + "name": "signature", + "nodeType": "VariableDeclaration", + "scope": 578, + "src": "5566:22:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 404, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "5566:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5377:217:0" + }, + "returnParameters": { + "id": 407, + "nodeType": "ParameterList", + "parameters": [], + "src": "5602:0:0" + }, + "scope": 1224, + "src": "5344:2246:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 625, + "nodeType": "Block", + "src": "7836:255:0", + "statements": [ + { + "assignments": [ + 598 + ], + "declarations": [ + { + "constant": false, + "id": 598, + "name": "transferHash", + "nodeType": "VariableDeclaration", + "scope": 625, + "src": "7846:20:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 597, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "7846:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 612, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 602, + "name": "ALLOWANCE_TRANSFER_TYPEHASH", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 36, + "src": "7903:27:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "argumentTypes": null, + "id": 603, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 580, + "src": "7932:4:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 604, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 582, + "src": "7938:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 605, + "name": "to", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 584, + "src": "7945:2:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 606, + "name": "amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 586, + "src": "7949:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + { + "argumentTypes": null, + "id": 607, + "name": "paymentToken", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 588, + "src": "7957:12:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 608, + "name": "payment", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 590, + "src": "7971:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + { + "argumentTypes": null, + "id": 609, + "name": "nonce", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 592, + "src": "7980: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": { + "argumentTypes": null, + "id": 600, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4964, + "src": "7892:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 601, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encode", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "7892:10:0", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencode_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 610, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7892:94:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 599, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4971, + "src": "7869:9:0", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 611, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7869:127:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "7846:150:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "hexValue": "30783139", + "id": 616, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8035:4:0", + "subdenomination": null, + "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": 615, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "8030:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes1_$", + "typeString": "type(bytes1)" + }, + "typeName": "byte" + }, + "id": 617, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8030:10:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "hexValue": "30783031", + "id": 619, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8047:4:0", + "subdenomination": null, + "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": 618, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "8042:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes1_$", + "typeString": "type(bytes1)" + }, + "typeName": "byte" + }, + "id": 620, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8042:10:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + { + "argumentTypes": null, + "id": 621, + "name": "domainSeparator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 63, + "src": "8054:15:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "argumentTypes": null, + "id": 622, + "name": "transferHash", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 598, + "src": "8071: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": { + "argumentTypes": null, + "id": 613, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4964, + "src": "8013:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 614, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "8013:16:0", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 623, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8013:71:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "functionReturnParameters": 596, + "id": 624, + "nodeType": "Return", + "src": "8006:78:0" + } + ] + }, + "documentation": null, + "id": 626, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "generateTransferHashData", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 593, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 580, + "name": "safe", + "nodeType": "VariableDeclaration", + "scope": 626, + "src": "7639:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 579, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "7639:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 582, + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 626, + "src": "7661:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 581, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "7661:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 584, + "name": "to", + "nodeType": "VariableDeclaration", + "scope": 626, + "src": "7684:10:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 583, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "7684:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 586, + "name": "amount", + "nodeType": "VariableDeclaration", + "scope": 626, + "src": "7704:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "typeName": { + "id": 585, + "name": "uint96", + "nodeType": "ElementaryTypeName", + "src": "7704:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 588, + "name": "paymentToken", + "nodeType": "VariableDeclaration", + "scope": 626, + "src": "7727:20:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 587, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "7727:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 590, + "name": "payment", + "nodeType": "VariableDeclaration", + "scope": 626, + "src": "7757:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "typeName": { + "id": 589, + "name": "uint96", + "nodeType": "ElementaryTypeName", + "src": "7757:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 592, + "name": "nonce", + "nodeType": "VariableDeclaration", + "scope": 626, + "src": "7781:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + }, + "typeName": { + "id": 591, + "name": "uint16", + "nodeType": "ElementaryTypeName", + "src": "7781:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "7629:170:0" + }, + "returnParameters": { + "id": 596, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 595, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 626, + "src": "7822:12:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 594, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "7822:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "7821:14:0" + }, + "scope": 1224, + "src": "7596:495:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "private" + }, + { + "body": { + "id": 657, + "nodeType": "Block", + "src": "8327:136:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 647, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 628, + "src": "8392:4:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 648, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 630, + "src": "8398:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 649, + "name": "to", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 632, + "src": "8405:2:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 650, + "name": "amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 634, + "src": "8409:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + { + "argumentTypes": null, + "id": 651, + "name": "paymentToken", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 636, + "src": "8417:12:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 652, + "name": "payment", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 638, + "src": "8431:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + { + "argumentTypes": null, + "id": 653, + "name": "nonce", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 640, + "src": "8440: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": 646, + "name": "generateTransferHashData", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 626, + "src": "8354: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": 654, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8354:101:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 645, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4971, + "src": "8344:9:0", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 655, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8344:112:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "functionReturnParameters": 644, + "id": 656, + "nodeType": "Return", + "src": "8337:119:0" + } + ] + }, + "documentation": null, + "id": 658, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "generateTransferHash", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 641, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 628, + "name": "safe", + "nodeType": "VariableDeclaration", + "scope": 658, + "src": "8136:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 627, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "8136:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 630, + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 658, + "src": "8158:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 629, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "8158:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 632, + "name": "to", + "nodeType": "VariableDeclaration", + "scope": 658, + "src": "8181:10:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 631, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "8181:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 634, + "name": "amount", + "nodeType": "VariableDeclaration", + "scope": 658, + "src": "8201:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "typeName": { + "id": 633, + "name": "uint96", + "nodeType": "ElementaryTypeName", + "src": "8201:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 636, + "name": "paymentToken", + "nodeType": "VariableDeclaration", + "scope": 658, + "src": "8224:20:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 635, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "8224:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 638, + "name": "payment", + "nodeType": "VariableDeclaration", + "scope": 658, + "src": "8254:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "typeName": { + "id": 637, + "name": "uint96", + "nodeType": "ElementaryTypeName", + "src": "8254:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 640, + "name": "nonce", + "nodeType": "VariableDeclaration", + "scope": 658, + "src": "8278:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + }, + "typeName": { + "id": 639, + "name": "uint16", + "nodeType": "ElementaryTypeName", + "src": "8278:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "8126:170:0" + }, + "returnParameters": { + "id": 644, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 643, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 658, + "src": "8318:7:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 642, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "8318:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "8317:9:0" + }, + "scope": 1224, + "src": "8097:366:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 696, + "nodeType": "Block", + "src": "8599:314:0", + "statements": [ + { + "assignments": [ + 670 + ], + "declarations": [ + { + "constant": false, + "id": 670, + "name": "signer", + "nodeType": "VariableDeclaration", + "scope": 696, + "src": "8609:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 669, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "8609:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 675, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 672, + "name": "signature", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 662, + "src": "8643:9:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + { + "argumentTypes": null, + "id": 673, + "name": "transferHashData", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 664, + "src": "8654: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": 671, + "name": "recoverSignature", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 818, + "src": "8626: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": 674, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8626:45:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "8609:62:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 692, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 679, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 677, + "name": "expectedDelegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 660, + "src": "8702:16:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "id": 678, + "name": "signer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 670, + "src": "8722:6:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "8702:26:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "&&", + "rightExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 691, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 680, + "name": "delegates", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 57, + "src": "8732:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_uint48_$_t_struct$_Delegate_$70_storage_$_$", + "typeString": "mapping(address => mapping(uint48 => struct AllowanceModule.Delegate storage ref))" + } + }, + "id": 684, + "indexExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 682, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 666, + "src": "8750:4:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + ], + "id": 681, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "8742:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 683, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8742:13:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "8732:24:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint48_$_t_struct$_Delegate_$70_storage_$", + "typeString": "mapping(uint48 => struct AllowanceModule.Delegate storage ref)" + } + }, + "id": 688, + "indexExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 686, + "name": "signer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 670, + "src": "8764:6:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 685, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "8757:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint48_$", + "typeString": "type(uint48)" + }, + "typeName": "uint48" + }, + "id": 687, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8757:14:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "8732:40:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$70_storage", + "typeString": "struct AllowanceModule.Delegate storage ref" + } + }, + "id": 689, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "delegate", + "nodeType": "MemberAccess", + "referencedDeclaration": 65, + "src": "8732:49:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "id": 690, + "name": "signer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 670, + "src": "8785:6:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "8732:59:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "8702:89:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "657870656374656444656c6567617465203d3d207369676e65722026262064656c6567617465735b616464726573732873616665295d5b75696e743438287369676e6572295d2e64656c6567617465203d3d207369676e6572", + "id": 693, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8805:91:0", + "subdenomination": null, + "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": 676, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 4980, + 4981 + ], + "referencedDeclaration": 4981, + "src": "8681:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 694, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8681:225:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 695, + "nodeType": "ExpressionStatement", + "src": "8681:225:0" + } + ] + }, + "documentation": null, + "id": 697, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "checkSignature", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 667, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 660, + "name": "expectedDelegate", + "nodeType": "VariableDeclaration", + "scope": 697, + "src": "8493:24:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 659, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "8493:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 662, + "name": "signature", + "nodeType": "VariableDeclaration", + "scope": 697, + "src": "8519:22:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 661, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "8519:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 664, + "name": "transferHashData", + "nodeType": "VariableDeclaration", + "scope": 697, + "src": "8543:29:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 663, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "8543:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 666, + "name": "safe", + "nodeType": "VariableDeclaration", + "scope": 697, + "src": "8574:15:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + }, + "typeName": { + "contractScope": null, + "id": 665, + "name": "GnosisSafe", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 18, + "src": "8574:10:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "8492:98:0" + }, + "returnParameters": { + "id": 668, + "nodeType": "ParameterList", + "parameters": [], + "src": "8599:0:0" + }, + "scope": 1224, + "src": "8469:444:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "private" + }, + { + "body": { + "id": 817, + "nodeType": "Block", + "src": "9037:1801:0", + "statements": [ + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 709, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 706, + "name": "signature", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 699, + "src": "9118:9:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 707, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "length", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "9118:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 708, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "9138:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "9118:21:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 713, + "nodeType": "IfStatement", + "src": "9114:44:0", + "trueBody": { + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 710, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4977, + "src": "9148:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 711, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "9148:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "functionReturnParameters": 705, + "id": 712, + "nodeType": "Return", + "src": "9141:17:0" + } + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 718, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 715, + "name": "signature", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 699, + "src": "9243:9:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 716, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "length", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "9243:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "argumentTypes": null, + "hexValue": "3635", + "id": 717, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "9263:2:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_65_by_1", + "typeString": "int_const 65" + }, + "value": "65" + }, + "src": "9243:22:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "7369676e6174757265732e6c656e677468203e3d203635", + "id": 719, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "9267:25:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_72679ed14e52badd3e78d9f29492b52cfb58b223fd9e00d5dca80ba1c385a7f7", + "typeString": "literal_string \"signatures.length >= 65\"" + }, + "value": "signatures.length >= 65" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_72679ed14e52badd3e78d9f29492b52cfb58b223fd9e00d5dca80ba1c385a7f7", + "typeString": "literal_string \"signatures.length >= 65\"" + } + ], + "id": 714, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 4980, + 4981 + ], + "referencedDeclaration": 4981, + "src": "9235:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 720, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9235:58:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 721, + "nodeType": "ExpressionStatement", + "src": "9235:58:0" + }, + { + "assignments": [ + 723 + ], + "declarations": [ + { + "constant": false, + "id": 723, + "name": "v", + "nodeType": "VariableDeclaration", + "scope": 817, + "src": "9303:7:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "typeName": { + "id": 722, + "name": "uint8", + "nodeType": "ElementaryTypeName", + "src": "9303:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 724, + "initialValue": null, + "nodeType": "VariableDeclarationStatement", + "src": "9303:7:0" + }, + { + "assignments": [ + 726 + ], + "declarations": [ + { + "constant": false, + "id": 726, + "name": "r", + "nodeType": "VariableDeclaration", + "scope": 817, + "src": "9320:9:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 725, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "9320:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 727, + "initialValue": null, + "nodeType": "VariableDeclarationStatement", + "src": "9320:9:0" + }, + { + "assignments": [ + 729 + ], + "declarations": [ + { + "constant": false, + "id": 729, + "name": "s", + "nodeType": "VariableDeclaration", + "scope": 817, + "src": "9339:9:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 728, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "9339:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 730, + "initialValue": null, + "nodeType": "VariableDeclarationStatement", + "src": "9339:9:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 739, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "components": [ + { + "argumentTypes": null, + "id": 731, + "name": "v", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 723, + "src": "9359:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + { + "argumentTypes": null, + "id": 732, + "name": "r", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 726, + "src": "9362:1:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "argumentTypes": null, + "id": 733, + "name": "s", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 729, + "src": "9365:1:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "id": 734, + "isConstant": false, + "isInlineArray": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "TupleExpression", + "src": "9358:9:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_uint8_$_t_bytes32_$_t_bytes32_$", + "typeString": "tuple(uint8,bytes32,bytes32)" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 736, + "name": "signature", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 699, + "src": "9385:9:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + { + "argumentTypes": null, + "hexValue": "30", + "id": 737, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "9396:1:0", + "subdenomination": null, + "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": 735, + "name": "signatureSplit", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3369, + "src": "9370: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": 738, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9370:28:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_uint8_$_t_bytes32_$_t_bytes32_$", + "typeString": "tuple(uint8,bytes32,bytes32)" + } + }, + "src": "9358:40:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 740, + "nodeType": "ExpressionStatement", + "src": "9358:40:0" + }, + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "id": 743, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 741, + "name": "v", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 723, + "src": "9465:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 742, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "9470:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "9465:6:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "id": 772, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 770, + "name": "v", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 723, + "src": "10193:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 771, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10198:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "10193:6:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "id": 781, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 779, + "name": "v", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 723, + "src": "10372:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "argumentTypes": null, + "hexValue": "3330", + "id": 780, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10376:2:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_30_by_1", + "typeString": "int_const 30" + }, + "value": "30" + }, + "src": "10372:6:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "id": 813, + "nodeType": "Block", + "src": "10683:149:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 811, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 802, + "name": "owner", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 704, + "src": "10766:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 805, + "name": "transferHashData", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 701, + "src": "10794:16:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 804, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4971, + "src": "10784:9:0", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 806, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10784:27:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "argumentTypes": null, + "id": 807, + "name": "v", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 723, + "src": "10813:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + { + "argumentTypes": null, + "id": 808, + "name": "r", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 726, + "src": "10816:1:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "argumentTypes": null, + "id": 809, + "name": "s", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 729, + "src": "10819: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": 803, + "name": "ecrecover", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4969, + "src": "10774: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": 810, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10774:47:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "10766:55:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 812, + "nodeType": "ExpressionStatement", + "src": "10766:55:0" + } + ] + }, + "id": 814, + "nodeType": "IfStatement", + "src": "10368:464:0", + "trueBody": { + "id": 801, + "nodeType": "Block", + "src": "10380:297:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 799, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 782, + "name": "owner", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 704, + "src": "10542:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "hexValue": "19457468657265756d205369676e6564204d6573736167653a0a3332", + "id": 787, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10587:34:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_178a2411ab6fbc1ba11064408972259c558d0e82fd48b0aba3ad81d14f065e73", + "typeString": "literal_string \"\u0019Ethereum Signed Message:\n32\"" + }, + "value": "\u0019Ethereum Signed Message:\n32" + }, + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 789, + "name": "transferHashData", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 701, + "src": "10633:16:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 788, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4971, + "src": "10623:9:0", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 790, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10623:27:0", + "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": { + "argumentTypes": null, + "id": 785, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4964, + "src": "10570:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 786, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "10570:16:0", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 791, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10570:81:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 784, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4971, + "src": "10560:9:0", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 792, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10560:92:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "id": 795, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 793, + "name": "v", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 723, + "src": "10654:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "argumentTypes": null, + "hexValue": "34", + "id": 794, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10658:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_4_by_1", + "typeString": "int_const 4" + }, + "value": "4" + }, + "src": "10654:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + { + "argumentTypes": null, + "id": 796, + "name": "r", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 726, + "src": "10661:1:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "argumentTypes": null, + "id": 797, + "name": "s", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 729, + "src": "10664: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": 783, + "name": "ecrecover", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4969, + "src": "10550: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": 798, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10550:116:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "10542:124:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 800, + "nodeType": "ExpressionStatement", + "src": "10542:124:0" + } + ] + } + }, + "id": 815, + "nodeType": "IfStatement", + "src": "10189:643:0", + "trueBody": { + "id": 778, + "nodeType": "Block", + "src": "10201:161:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 776, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 773, + "name": "owner", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 704, + "src": "10333:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 774, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4977, + "src": "10341:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 775, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "10341:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "src": "10333:18:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 777, + "nodeType": "ExpressionStatement", + "src": "10333:18:0" + } + ] + } + }, + "id": 816, + "nodeType": "IfStatement", + "src": "9461:1371:0", + "trueBody": { + "id": 769, + "nodeType": "Block", + "src": "9473:710:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 750, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 744, + "name": "owner", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 704, + "src": "9582:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 747, + "name": "r", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 726, + "src": "9606:1:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 746, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "9598:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + }, + "typeName": "uint256" + }, + "id": 748, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9598:10:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 745, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "9590:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 749, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9590:19:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "src": "9582:27:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 751, + "nodeType": "ExpressionStatement", + "src": "9582:27:0" + }, + { + "assignments": [ + 753 + ], + "declarations": [ + { + "constant": false, + "id": 753, + "name": "contractSignature", + "nodeType": "VariableDeclaration", + "scope": 769, + "src": "9623:30:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 752, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "9623:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 754, + "initialValue": null, + "nodeType": "VariableDeclarationStatement", + "src": "9623:30:0" + }, + { + "externalReferences": [ + { + "contractSignature": { + "declaration": 753, + "isOffset": false, + "isSlot": false, + "src": "9897:17:0", + "valueSize": 1 + } + }, + { + "signature": { + "declaration": 699, + "isOffset": false, + "isSlot": false, + "src": "9926:9:0", + "valueSize": 1 + } + }, + { + "s": { + "declaration": 729, + "isOffset": false, + "isSlot": false, + "src": "9937:1:0", + "valueSize": 1 + } + } + ], + "id": 755, + "nodeType": "InlineAssembly", + "operations": "{\n contractSignature := add(add(signature, s), 0x20)\n}", + "src": "9735:225:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_bytes4", + "typeString": "bytes4" + }, + "id": 765, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 761, + "name": "transferHashData", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 701, + "src": "10042:16:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + { + "argumentTypes": null, + "id": 762, + "name": "contractSignature", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 753, + "src": "10060:17: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" + } + ], + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 758, + "name": "owner", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 704, + "src": "10018:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 757, + "name": "ISignatureValidator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3516, + "src": "9998:19:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_ISignatureValidator_$3516_$", + "typeString": "type(contract ISignatureValidator)" + } + }, + "id": 759, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9998:26:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_ISignatureValidator_$3516", + "typeString": "contract ISignatureValidator" + } + }, + "id": 760, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "isValidSignature", + "nodeType": "MemberAccess", + "referencedDeclaration": 3515, + "src": "9998:43:0", + "typeDescriptions": { + "typeIdentifier": "t_function_external_view$_t_bytes_memory_ptr_$_t_bytes_memory_ptr_$returns$_t_bytes4_$", + "typeString": "function (bytes memory,bytes memory) view external returns (bytes4)" + } + }, + "id": 763, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9998:80:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes4", + "typeString": "bytes4" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "id": 764, + "name": "EIP1271_MAGIC_VALUE", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3503, + "src": "10082:19:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes4", + "typeString": "bytes4" + } + }, + "src": "9998:103:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "436f756c64206e6f742076616c6964617465204549502d31323731207369676e6174757265", + "id": 766, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10119:39:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_28b765f195c3cd598e06ecb11ef8b4894757ebf4babad4a035bcaf2f5d0e18e5", + "typeString": "literal_string \"Could not validate EIP-1271 signature\"" + }, + "value": "Could not validate EIP-1271 signature" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_28b765f195c3cd598e06ecb11ef8b4894757ebf4babad4a035bcaf2f5d0e18e5", + "typeString": "literal_string \"Could not validate EIP-1271 signature\"" + } + ], + "id": 756, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 4980, + 4981 + ], + "referencedDeclaration": 4981, + "src": "9973:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 767, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9973:199:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 768, + "nodeType": "ExpressionStatement", + "src": "9973:199:0" + } + ] + } + } + ] + }, + "documentation": null, + "id": 818, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "recoverSignature", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 702, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 699, + "name": "signature", + "nodeType": "VariableDeclaration", + "scope": 818, + "src": "8945:22:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 698, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "8945:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 701, + "name": "transferHashData", + "nodeType": "VariableDeclaration", + "scope": 818, + "src": "8969:29:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 700, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "8969:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "8944:55:0" + }, + "returnParameters": { + "id": 705, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 704, + "name": "owner", + "nodeType": "VariableDeclaration", + "scope": 818, + "src": "9022:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 703, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "9022:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "9021:15:0" + }, + "scope": 1224, + "src": "8919:1919:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "private" + }, + { + "body": { + "id": 872, + "nodeType": "Block", + "src": "10937:476:0", + "statements": [ + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 833, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 829, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 822, + "src": "10951:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "hexValue": "30", + "id": 831, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10968:1:0", + "subdenomination": null, + "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": 830, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "10960:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 832, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10960:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "src": "10951:19:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "id": 870, + "nodeType": "Block", + "src": "11172:235:0", + "statements": [ + { + "assignments": [ + 849 + ], + "declarations": [ + { + "constant": false, + "id": 849, + "name": "data", + "nodeType": "VariableDeclaration", + "scope": 870, + "src": "11186:17:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 848, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "11186:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 856, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "hexValue": "7472616e7366657228616464726573732c75696e7432353629", + "id": 852, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "11230:27:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_a9059cbb2ab09eb219583f4a59a5d0623ade346d962bcd4e46b11da047c9049b", + "typeString": "literal_string \"transfer(address,uint256)\"" + }, + "value": "transfer(address,uint256)" + }, + { + "argumentTypes": null, + "id": 853, + "name": "to", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 824, + "src": "11259:2:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 854, + "name": "amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 826, + "src": "11263: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": { + "argumentTypes": null, + "id": 850, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4964, + "src": "11206:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 851, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encodeWithSignature", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "11206: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": 855, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11206:64:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "11186:84:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 860, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 822, + "src": "11323:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "hexValue": "30", + "id": 861, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "11330:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + { + "argumentTypes": null, + "id": 862, + "name": "data", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 849, + "src": "11333:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 863, + "name": "Enum", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3235, + "src": "11339:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_Enum_$3235_$", + "typeString": "type(contract Enum)" + } + }, + "id": 864, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "Operation", + "nodeType": "MemberAccess", + "referencedDeclaration": 3234, + "src": "11339:14:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Operation_$3234_$", + "typeString": "type(enum Enum.Operation)" + } + }, + "id": 865, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "Call", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "11339:19:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Operation_$3234", + "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_$3234", + "typeString": "enum Enum.Operation" + } + ], + "expression": { + "argumentTypes": null, + "id": 858, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 820, + "src": "11292:4:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + }, + "id": 859, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "execTransactionFromModule", + "nodeType": "MemberAccess", + "referencedDeclaration": 17, + "src": "11292:30:0", + "typeDescriptions": { + "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$_t_bytes_memory_ptr_$_t_enum$_Operation_$3234_$returns$_t_bool_$", + "typeString": "function (address,uint256,bytes memory,enum Enum.Operation) external returns (bool)" + } + }, + "id": 866, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11292:67:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "436f756c64206e6f74206578656375746520746f6b656e207472616e73666572", + "id": 867, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "11361:34:0", + "subdenomination": null, + "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": 857, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 4980, + 4981 + ], + "referencedDeclaration": 4981, + "src": "11284:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 868, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11284:112:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 869, + "nodeType": "ExpressionStatement", + "src": "11284:112:0" + } + ] + }, + "id": 871, + "nodeType": "IfStatement", + "src": "10947:460:0", + "trueBody": { + "id": 847, + "nodeType": "Block", + "src": "10972:194:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 837, + "name": "to", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 824, + "src": "11082:2:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 838, + "name": "amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 826, + "src": "11086:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + { + "argumentTypes": null, + "hexValue": "", + "id": 839, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "11094:2:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470", + "typeString": "literal_string \"\"" + }, + "value": "" + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 840, + "name": "Enum", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3235, + "src": "11098:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_Enum_$3235_$", + "typeString": "type(contract Enum)" + } + }, + "id": 841, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "Operation", + "nodeType": "MemberAccess", + "referencedDeclaration": 3234, + "src": "11098:14:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Operation_$3234_$", + "typeString": "type(enum Enum.Operation)" + } + }, + "id": 842, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "Call", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "11098:19:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Operation_$3234", + "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_$3234", + "typeString": "enum Enum.Operation" + } + ], + "expression": { + "argumentTypes": null, + "id": 835, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 820, + "src": "11051:4:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + }, + "id": 836, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "execTransactionFromModule", + "nodeType": "MemberAccess", + "referencedDeclaration": 17, + "src": "11051:30:0", + "typeDescriptions": { + "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$_t_bytes_memory_ptr_$_t_enum$_Operation_$3234_$returns$_t_bool_$", + "typeString": "function (address,uint256,bytes memory,enum Enum.Operation) external returns (bool)" + } + }, + "id": 843, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11051:67:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "436f756c64206e6f742065786563757465206574686572207472616e73666572", + "id": 844, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "11120:34:0", + "subdenomination": null, + "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": 834, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 4980, + 4981 + ], + "referencedDeclaration": 4981, + "src": "11043:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 845, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11043:112:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 846, + "nodeType": "ExpressionStatement", + "src": "11043:112:0" + } + ] + } + } + ] + }, + "documentation": null, + "id": 873, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "transfer", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 827, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 820, + "name": "safe", + "nodeType": "VariableDeclaration", + "scope": 873, + "src": "10862:15:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + }, + "typeName": { + "contractScope": null, + "id": 819, + "name": "GnosisSafe", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 18, + "src": "10862:10:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 822, + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 873, + "src": "10879:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 821, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "10879:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 824, + "name": "to", + "nodeType": "VariableDeclaration", + "scope": 873, + "src": "10894:18:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + "typeName": { + "id": 823, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "10894:15:0", + "stateMutability": "payable", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 826, + "name": "amount", + "nodeType": "VariableDeclaration", + "scope": 873, + "src": "10914:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "typeName": { + "id": 825, + "name": "uint96", + "nodeType": "ElementaryTypeName", + "src": "10914:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "10861:67:0" + }, + "returnParameters": { + "id": 828, + "nodeType": "ParameterList", + "parameters": [], + "src": "10937:0:0" + }, + "scope": 1224, + "src": "10844:569:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "private" + }, + { + "body": { + "id": 889, + "nodeType": "Block", + "src": "11509:46:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 883, + "name": "tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 51, + "src": "11526: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": 885, + "indexExpression": { + "argumentTypes": null, + "id": 884, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 875, + "src": "11533:4:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "11526:12:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_array$_t_address_$dyn_storage_$", + "typeString": "mapping(address => address[] storage ref)" + } + }, + "id": 887, + "indexExpression": { + "argumentTypes": null, + "id": 886, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 877, + "src": "11539:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "11526:22:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "functionReturnParameters": 882, + "id": 888, + "nodeType": "Return", + "src": "11519:29:0" + } + ] + }, + "documentation": null, + "id": 890, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getTokens", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 878, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 875, + "name": "safe", + "nodeType": "VariableDeclaration", + "scope": 890, + "src": "11438:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 874, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "11438:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 877, + "name": "delegate", + "nodeType": "VariableDeclaration", + "scope": 890, + "src": "11452:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 876, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "11452:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "11437:32:0" + }, + "returnParameters": { + "id": 882, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 881, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 890, + "src": "11491:16:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[]" + }, + "typeName": { + "baseType": { + "id": 879, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "11491:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 880, + "length": null, + "nodeType": "ArrayTypeName", + "src": "11491:9:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "11490:18:0" + }, + "scope": 1224, + "src": "11419:136:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 933, + "nodeType": "Block", + "src": "11675:313:0", + "statements": [ + { + "assignments": [ + 904 + ], + "declarations": [ + { + "constant": false, + "id": 904, + "name": "allowance", + "nodeType": "VariableDeclaration", + "scope": 933, + "src": "11685:26:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance" + }, + "typeName": { + "contractScope": null, + "id": 903, + "name": "Allowance", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 81, + "src": "11685:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_storage_ptr", + "typeString": "struct AllowanceModule.Allowance" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 910, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 906, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 892, + "src": "11727:4:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 907, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 894, + "src": "11733:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 908, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 896, + "src": "11743: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": 905, + "name": "getAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 336, + "src": "11714:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_address_$_t_address_$_t_address_$returns$_t_struct$_Allowance_$81_memory_ptr_$", + "typeString": "function (address,address,address) view returns (struct AllowanceModule.Allowance memory)" + } + }, + "id": 909, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11714:35:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "11685:64:0" + }, + { + "expression": { + "argumentTypes": null, + "components": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 912, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 904, + "src": "11788:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 913, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "amount", + "nodeType": "MemberAccess", + "referencedDeclaration": 72, + "src": "11788:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + ], + "id": 911, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "11780:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + }, + "typeName": "uint256" + }, + "id": 914, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11780:25:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 916, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 904, + "src": "11827:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 917, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "spent", + "nodeType": "MemberAccess", + "referencedDeclaration": 74, + "src": "11827:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + ], + "id": 915, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "11819:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + }, + "typeName": "uint256" + }, + "id": 918, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11819:24:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 920, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 904, + "src": "11865:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 921, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "resetTimeMin", + "nodeType": "MemberAccess", + "referencedDeclaration": 76, + "src": "11865:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + ], + "id": 919, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "11857:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + }, + "typeName": "uint256" + }, + "id": 922, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11857:31:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 924, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 904, + "src": "11910:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 925, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "lastResetMin", + "nodeType": "MemberAccess", + "referencedDeclaration": 78, + "src": "11910:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + ], + "id": 923, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "11902:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + }, + "typeName": "uint256" + }, + "id": 926, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11902:31:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 928, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 904, + "src": "11955:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 929, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "nonce", + "nodeType": "MemberAccess", + "referencedDeclaration": 80, + "src": "11955:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + ], + "id": 927, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "11947:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + }, + "typeName": "uint256" + }, + "id": 930, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11947:24:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 931, + "isConstant": false, + "isInlineArray": true, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "11766:215:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$5_memory_ptr", + "typeString": "uint256[5] memory" + } + }, + "functionReturnParameters": 902, + "id": 932, + "nodeType": "Return", + "src": "11759:222:0" + } + ] + }, + "documentation": null, + "id": 934, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getTokenAllowance", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 897, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 892, + "name": "safe", + "nodeType": "VariableDeclaration", + "scope": 934, + "src": "11588:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 891, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "11588:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 894, + "name": "delegate", + "nodeType": "VariableDeclaration", + "scope": 934, + "src": "11602:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 893, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "11602:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 896, + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 934, + "src": "11620:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 895, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "11620:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "11587:47:0" + }, + "returnParameters": { + "id": 902, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 901, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 934, + "src": "11656:17:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$5_memory_ptr", + "typeString": "uint256[5]" + }, + "typeName": { + "baseType": { + "id": 898, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "11656:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 900, + "length": { + "argumentTypes": null, + "hexValue": "35", + "id": 899, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "11664:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_5_by_1", + "typeString": "int_const 5" + }, + "value": "5" + }, + "nodeType": "ArrayTypeName", + "src": "11656:10:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$5_storage_ptr", + "typeString": "uint256[5]" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "11655:19:0" + }, + "scope": 1224, + "src": "11561:427:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 1010, + "nodeType": "Block", + "src": "12040:517:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 944, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 940, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 936, + "src": "12058:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "hexValue": "30", + "id": 942, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12078:1:0", + "subdenomination": null, + "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": 941, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "12070:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 943, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12070:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "src": "12058:22:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "496e76616c69642064656c65676174652061646472657373", + "id": 945, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12082:26:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_2748b75fa8e9228d9f46d849def917a80513930a212cbb86b833e29bb53a5909", + "typeString": "literal_string \"Invalid delegate address\"" + }, + "value": "Invalid delegate address" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_2748b75fa8e9228d9f46d849def917a80513930a212cbb86b833e29bb53a5909", + "typeString": "literal_string \"Invalid delegate address\"" + } + ], + "id": 939, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 4980, + 4981 + ], + "referencedDeclaration": 4981, + "src": "12050:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 946, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12050:59:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 947, + "nodeType": "ExpressionStatement", + "src": "12050:59:0" + }, + { + "assignments": [ + 949 + ], + "declarations": [ + { + "constant": false, + "id": 949, + "name": "index", + "nodeType": "VariableDeclaration", + "scope": 1010, + "src": "12119:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + }, + "typeName": { + "id": 948, + "name": "uint48", + "nodeType": "ElementaryTypeName", + "src": "12119:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 953, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 951, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 936, + "src": "12141:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 950, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "12134:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint48_$", + "typeString": "type(uint48)" + }, + "typeName": "uint48" + }, + "id": 952, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12134:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "12119:31:0" + }, + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 964, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 954, + "name": "delegates", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 57, + "src": "12213:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_uint48_$_t_struct$_Delegate_$70_storage_$_$", + "typeString": "mapping(address => mapping(uint48 => struct AllowanceModule.Delegate storage ref))" + } + }, + "id": 957, + "indexExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 955, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4977, + "src": "12223:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 956, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "12223:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "12213:21:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint48_$_t_struct$_Delegate_$70_storage_$", + "typeString": "mapping(uint48 => struct AllowanceModule.Delegate storage ref)" + } + }, + "id": 959, + "indexExpression": { + "argumentTypes": null, + "id": 958, + "name": "index", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 949, + "src": "12235:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "12213:28:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$70_storage", + "typeString": "struct AllowanceModule.Delegate storage ref" + } + }, + "id": 960, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "delegate", + "nodeType": "MemberAccess", + "referencedDeclaration": 65, + "src": "12213:37:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "hexValue": "30", + "id": 962, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12262:1:0", + "subdenomination": null, + "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": 961, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "12254:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 963, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12254:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "src": "12213:51:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 966, + "nodeType": "IfStatement", + "src": "12210:63:0", + "trueBody": { + "expression": null, + "functionReturnParameters": 938, + "id": 965, + "nodeType": "Return", + "src": "12266:7:0" + } + }, + { + "assignments": [ + 968 + ], + "declarations": [ + { + "constant": false, + "id": 968, + "name": "startIndex", + "nodeType": "VariableDeclaration", + "scope": 1010, + "src": "12282:17:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + }, + "typeName": { + "id": 967, + "name": "uint48", + "nodeType": "ElementaryTypeName", + "src": "12282:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 973, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 969, + "name": "delegatesStart", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 61, + "src": "12302:14:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint48_$", + "typeString": "mapping(address => uint48)" + } + }, + "id": 972, + "indexExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 970, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4977, + "src": "12317:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 971, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "12317:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "12302:26:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "12282:46:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 985, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 974, + "name": "delegates", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 57, + "src": "12338:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_uint48_$_t_struct$_Delegate_$70_storage_$_$", + "typeString": "mapping(address => mapping(uint48 => struct AllowanceModule.Delegate storage ref))" + } + }, + "id": 978, + "indexExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 975, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4977, + "src": "12348:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 976, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "12348:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "12338:21:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint48_$_t_struct$_Delegate_$70_storage_$", + "typeString": "mapping(uint48 => struct AllowanceModule.Delegate storage ref)" + } + }, + "id": 979, + "indexExpression": { + "argumentTypes": null, + "id": 977, + "name": "index", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 949, + "src": "12360:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "12338:28:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$70_storage", + "typeString": "struct AllowanceModule.Delegate storage ref" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 981, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 936, + "src": "12378:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "hexValue": "30", + "id": 982, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12388:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + { + "argumentTypes": null, + "id": 983, + "name": "startIndex", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 968, + "src": "12391: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": 980, + "name": "Delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 70, + "src": "12369:8:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_struct$_Delegate_$70_storage_ptr_$", + "typeString": "type(struct AllowanceModule.Delegate storage pointer)" + } + }, + "id": 984, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "structConstructorCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12369:33:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$70_memory", + "typeString": "struct AllowanceModule.Delegate memory" + } + }, + "src": "12338:64:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$70_storage", + "typeString": "struct AllowanceModule.Delegate storage ref" + } + }, + "id": 986, + "nodeType": "ExpressionStatement", + "src": "12338:64:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 995, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 987, + "name": "delegates", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 57, + "src": "12412:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_uint48_$_t_struct$_Delegate_$70_storage_$_$", + "typeString": "mapping(address => mapping(uint48 => struct AllowanceModule.Delegate storage ref))" + } + }, + "id": 991, + "indexExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 988, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4977, + "src": "12422:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 989, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "12422:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "12412:21:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint48_$_t_struct$_Delegate_$70_storage_$", + "typeString": "mapping(uint48 => struct AllowanceModule.Delegate storage ref)" + } + }, + "id": 992, + "indexExpression": { + "argumentTypes": null, + "id": 990, + "name": "startIndex", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 968, + "src": "12434:10:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "12412:33:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$70_storage", + "typeString": "struct AllowanceModule.Delegate storage ref" + } + }, + "id": 993, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "prev", + "nodeType": "MemberAccess", + "referencedDeclaration": 67, + "src": "12412:38:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 994, + "name": "index", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 949, + "src": "12453:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "src": "12412:46:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "id": 996, + "nodeType": "ExpressionStatement", + "src": "12412:46:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 1002, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 997, + "name": "delegatesStart", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 61, + "src": "12468:14:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint48_$", + "typeString": "mapping(address => uint48)" + } + }, + "id": 1000, + "indexExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 998, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4977, + "src": "12483:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 999, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "12483:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "12468:26:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 1001, + "name": "index", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 949, + "src": "12497:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "src": "12468:34:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "id": 1003, + "nodeType": "ExpressionStatement", + "src": "12468:34:0" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1005, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4977, + "src": "12529:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1006, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "12529:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 1007, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 936, + "src": "12541:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 1004, + "name": "AddDelegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 87, + "src": "12517:11:0", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$returns$__$", + "typeString": "function (address,address)" + } + }, + "id": 1008, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12517:33:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1009, + "nodeType": "EmitStatement", + "src": "12512:38:0" + } + ] + }, + "documentation": null, + "id": 1011, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "addDelegate", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 937, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 936, + "name": "delegate", + "nodeType": "VariableDeclaration", + "scope": 1011, + "src": "12015:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 935, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "12015:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "12014:18:0" + }, + "returnParameters": { + "id": 938, + "nodeType": "ParameterList", + "parameters": [], + "src": "12040:0:0" + }, + "scope": 1224, + "src": "11994:563:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 1136, + "nodeType": "Block", + "src": "12612:918:0", + "statements": [ + { + "assignments": [ + 1017 + ], + "declarations": [ + { + "constant": false, + "id": 1017, + "name": "current", + "nodeType": "VariableDeclaration", + "scope": 1136, + "src": "12622:23:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$70_memory_ptr", + "typeString": "struct AllowanceModule.Delegate" + }, + "typeName": { + "contractScope": null, + "id": 1016, + "name": "Delegate", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 70, + "src": "12622:8:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$70_storage_ptr", + "typeString": "struct AllowanceModule.Delegate" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 1026, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1018, + "name": "delegates", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 57, + "src": "12648:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_uint48_$_t_struct$_Delegate_$70_storage_$_$", + "typeString": "mapping(address => mapping(uint48 => struct AllowanceModule.Delegate storage ref))" + } + }, + "id": 1021, + "indexExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1019, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4977, + "src": "12658:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1020, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "12658:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "12648:21:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint48_$_t_struct$_Delegate_$70_storage_$", + "typeString": "mapping(uint48 => struct AllowanceModule.Delegate storage ref)" + } + }, + "id": 1025, + "indexExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1023, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1013, + "src": "12677:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 1022, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "12670:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint48_$", + "typeString": "type(uint48)" + }, + "typeName": "uint48" + }, + "id": 1024, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12670:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "12648:39:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$70_storage", + "typeString": "struct AllowanceModule.Delegate storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "12622:65:0" + }, + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 1032, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1027, + "name": "current", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1017, + "src": "12750:7:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$70_memory_ptr", + "typeString": "struct AllowanceModule.Delegate memory" + } + }, + "id": 1028, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "delegate", + "nodeType": "MemberAccess", + "referencedDeclaration": 65, + "src": "12750:16:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "hexValue": "30", + "id": 1030, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12778:1:0", + "subdenomination": null, + "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": 1029, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "12770:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 1031, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12770:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "src": "12750:30:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 1034, + "nodeType": "IfStatement", + "src": "12747:42:0", + "trueBody": { + "expression": null, + "functionReturnParameters": 1015, + "id": 1033, + "nodeType": "Return", + "src": "12782:7:0" + } + }, + { + "assignments": [ + 1038 + ], + "declarations": [ + { + "constant": false, + "id": 1038, + "name": "delegateTokens", + "nodeType": "VariableDeclaration", + "scope": 1136, + "src": "12798:32:0", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + }, + "typeName": { + "baseType": { + "id": 1036, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "12798:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 1037, + "length": null, + "nodeType": "ArrayTypeName", + "src": "12798:9:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 1045, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1039, + "name": "tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 51, + "src": "12833: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": 1042, + "indexExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1040, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4977, + "src": "12840:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1041, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "12840:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "12833:18:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_array$_t_address_$dyn_storage_$", + "typeString": "mapping(address => address[] storage ref)" + } + }, + "id": 1044, + "indexExpression": { + "argumentTypes": null, + "id": 1043, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1013, + "src": "12852:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "12833:28:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "12798:63:0" + }, + { + "body": { + "id": 1104, + "nodeType": "Block", + "src": "12923:420:0", + "statements": [ + { + "assignments": [ + 1058 + ], + "declarations": [ + { + "constant": false, + "id": 1058, + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 1104, + "src": "12937:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1057, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "12937:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 1062, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1059, + "name": "delegateTokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1038, + "src": "12953:14:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[] storage pointer" + } + }, + "id": 1061, + "indexExpression": { + "argumentTypes": null, + "id": 1060, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1047, + "src": "12968:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "12953:17:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "12937:33:0" + }, + { + "assignments": [ + 1064 + ], + "declarations": [ + { + "constant": false, + "id": 1064, + "name": "allowance", + "nodeType": "VariableDeclaration", + "scope": 1104, + "src": "13046:26:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance" + }, + "typeName": { + "contractScope": null, + "id": 1063, + "name": "Allowance", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 81, + "src": "13046:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_storage_ptr", + "typeString": "struct AllowanceModule.Allowance" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 1071, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1066, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4977, + "src": "13088:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1067, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "13088:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 1068, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1013, + "src": "13100:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 1069, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1058, + "src": "13110: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": 1065, + "name": "getAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 336, + "src": "13075:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_address_$_t_address_$_t_address_$returns$_t_struct$_Allowance_$81_memory_ptr_$", + "typeString": "function (address,address,address) view returns (struct AllowanceModule.Allowance memory)" + } + }, + "id": 1070, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13075:41:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "13046:70:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 1076, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1072, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1064, + "src": "13130:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 1074, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "amount", + "nodeType": "MemberAccess", + "referencedDeclaration": 72, + "src": "13130:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "30", + "id": 1075, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13149:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "13130:20:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "id": 1077, + "nodeType": "ExpressionStatement", + "src": "13130:20:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 1082, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1078, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1064, + "src": "13164:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 1080, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "spent", + "nodeType": "MemberAccess", + "referencedDeclaration": 74, + "src": "13164:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "30", + "id": 1081, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13182:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "13164:19:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "id": 1083, + "nodeType": "ExpressionStatement", + "src": "13164:19:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 1088, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1084, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1064, + "src": "13197:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 1086, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "resetTimeMin", + "nodeType": "MemberAccess", + "referencedDeclaration": 76, + "src": "13197:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "30", + "id": 1087, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13222:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "13197:26:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "id": 1089, + "nodeType": "ExpressionStatement", + "src": "13197:26:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 1094, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1090, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1064, + "src": "13237:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 1092, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "lastResetMin", + "nodeType": "MemberAccess", + "referencedDeclaration": 78, + "src": "13237:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "30", + "id": 1093, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13262:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "13237:26:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "id": 1095, + "nodeType": "ExpressionStatement", + "src": "13237:26:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1097, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4977, + "src": "13293:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1098, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "13293:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 1099, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1013, + "src": "13305:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 1100, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1058, + "src": "13315:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 1101, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1064, + "src": "13322:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_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_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + ], + "id": 1096, + "name": "updateAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 358, + "src": "13277:15:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_address_$_t_struct$_Allowance_$81_memory_ptr_$returns$__$", + "typeString": "function (address,address,address,struct AllowanceModule.Allowance memory)" + } + }, + "id": 1102, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13277:55:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1103, + "nodeType": "ExpressionStatement", + "src": "13277:55:0" + } + ] + }, + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 1053, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 1050, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1047, + "src": "12891:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1051, + "name": "delegateTokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1038, + "src": "12895:14:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[] storage pointer" + } + }, + "id": 1052, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "length", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "12895:21:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "12891:25:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 1105, + "initializationExpression": { + "assignments": [ + 1047 + ], + "declarations": [ + { + "constant": false, + "id": 1047, + "name": "i", + "nodeType": "VariableDeclaration", + "scope": 1105, + "src": "12876:9:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1046, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "12876:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 1049, + "initialValue": { + "argumentTypes": null, + "hexValue": "30", + "id": 1048, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12888:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "nodeType": "VariableDeclarationStatement", + "src": "12876:13:0" + }, + "loopExpression": { + "expression": { + "argumentTypes": null, + "id": 1055, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "12918:3:0", + "subExpression": { + "argumentTypes": null, + "id": 1054, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1047, + "src": "12918:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 1056, + "nodeType": "ExpressionStatement", + "src": "12918:3:0" + }, + "nodeType": "ForStatement", + "src": "12871:472:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 1116, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1106, + "name": "delegates", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 57, + "src": "13352:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_uint48_$_t_struct$_Delegate_$70_storage_$_$", + "typeString": "mapping(address => mapping(uint48 => struct AllowanceModule.Delegate storage ref))" + } + }, + "id": 1111, + "indexExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1107, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4977, + "src": "13362:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1108, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "13362:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "13352:21:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint48_$_t_struct$_Delegate_$70_storage_$", + "typeString": "mapping(uint48 => struct AllowanceModule.Delegate storage ref)" + } + }, + "id": 1112, + "indexExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1109, + "name": "current", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1017, + "src": "13374:7:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$70_memory_ptr", + "typeString": "struct AllowanceModule.Delegate memory" + } + }, + "id": 1110, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "prev", + "nodeType": "MemberAccess", + "referencedDeclaration": 67, + "src": "13374:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "13352:35:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$70_storage", + "typeString": "struct AllowanceModule.Delegate storage ref" + } + }, + "id": 1113, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "next", + "nodeType": "MemberAccess", + "referencedDeclaration": 69, + "src": "13352:40:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1114, + "name": "current", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1017, + "src": "13395:7:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$70_memory_ptr", + "typeString": "struct AllowanceModule.Delegate memory" + } + }, + "id": 1115, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "next", + "nodeType": "MemberAccess", + "referencedDeclaration": 69, + "src": "13395:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "src": "13352:55:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "id": 1117, + "nodeType": "ExpressionStatement", + "src": "13352:55:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 1128, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1118, + "name": "delegates", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 57, + "src": "13417:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_uint48_$_t_struct$_Delegate_$70_storage_$_$", + "typeString": "mapping(address => mapping(uint48 => struct AllowanceModule.Delegate storage ref))" + } + }, + "id": 1123, + "indexExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1119, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4977, + "src": "13427:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1120, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "13427:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "13417:21:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint48_$_t_struct$_Delegate_$70_storage_$", + "typeString": "mapping(uint48 => struct AllowanceModule.Delegate storage ref)" + } + }, + "id": 1124, + "indexExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1121, + "name": "current", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1017, + "src": "13439:7:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$70_memory_ptr", + "typeString": "struct AllowanceModule.Delegate memory" + } + }, + "id": 1122, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "next", + "nodeType": "MemberAccess", + "referencedDeclaration": 69, + "src": "13439:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "13417:35:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$70_storage", + "typeString": "struct AllowanceModule.Delegate storage ref" + } + }, + "id": 1125, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "prev", + "nodeType": "MemberAccess", + "referencedDeclaration": 67, + "src": "13417:40:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1126, + "name": "current", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1017, + "src": "13460:7:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$70_memory_ptr", + "typeString": "struct AllowanceModule.Delegate memory" + } + }, + "id": 1127, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "prev", + "nodeType": "MemberAccess", + "referencedDeclaration": 67, + "src": "13460:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "src": "13417:55:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "id": 1129, + "nodeType": "ExpressionStatement", + "src": "13417:55:0" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1131, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4977, + "src": "13502:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1132, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "13502:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 1133, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1013, + "src": "13514:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 1130, + "name": "RemoveDelegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 93, + "src": "13487:14:0", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$returns$__$", + "typeString": "function (address,address)" + } + }, + "id": 1134, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13487:36:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1135, + "nodeType": "EmitStatement", + "src": "13482:41:0" + } + ] + }, + "documentation": null, + "id": 1137, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "removeDelegate", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1014, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1013, + "name": "delegate", + "nodeType": "VariableDeclaration", + "scope": 1137, + "src": "12587:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1012, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "12587:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "12586:18:0" + }, + "returnParameters": { + "id": 1015, + "nodeType": "ParameterList", + "parameters": [], + "src": "12612:0:0" + }, + "scope": 1224, + "src": "12563:967:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 1222, + "nodeType": "Block", + "src": "13662:633:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 1157, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 1151, + "name": "results", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1147, + "src": "13672:7:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1155, + "name": "pageSize", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1143, + "src": "13696:8:0", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + ], + "id": 1154, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "NewExpression", + "src": "13682:13:0", + "typeDescriptions": { + "typeIdentifier": "t_function_objectcreation_pure$_t_uint256_$returns$_t_array$_t_address_$dyn_memory_$", + "typeString": "function (uint256) pure returns (address[] memory)" + }, + "typeName": { + "baseType": { + "id": 1152, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "13686:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 1153, + "length": null, + "nodeType": "ArrayTypeName", + "src": "13686:9:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + } + } + }, + "id": 1156, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13682:23:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory", + "typeString": "address[] memory" + } + }, + "src": "13672:33:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + "id": 1158, + "nodeType": "ExpressionStatement", + "src": "13672:33:0" + }, + { + "assignments": [ + 1160 + ], + "declarations": [ + { + "constant": false, + "id": 1160, + "name": "i", + "nodeType": "VariableDeclaration", + "scope": 1222, + "src": "13715:7:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "typeName": { + "id": 1159, + "name": "uint8", + "nodeType": "ElementaryTypeName", + "src": "13715:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 1162, + "initialValue": { + "argumentTypes": null, + "hexValue": "30", + "id": 1161, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13725:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "nodeType": "VariableDeclarationStatement", + "src": "13715:11:0" + }, + { + "assignments": [ + 1164 + ], + "declarations": [ + { + "constant": false, + "id": 1164, + "name": "initialIndex", + "nodeType": "VariableDeclaration", + "scope": 1222, + "src": "13736:19:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + }, + "typeName": { + "id": 1163, + "name": "uint48", + "nodeType": "ElementaryTypeName", + "src": "13736:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 1174, + "initialValue": { + "argumentTypes": null, + "condition": { + "argumentTypes": null, + "components": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + }, + "id": 1167, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 1165, + "name": "start", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1141, + "src": "13759:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 1166, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13768:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "13759:10:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "id": 1168, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "13758:12:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1170, + "name": "delegatesStart", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 61, + "src": "13781:14:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint48_$", + "typeString": "mapping(address => uint48)" + } + }, + "id": 1172, + "indexExpression": { + "argumentTypes": null, + "id": 1171, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1139, + "src": "13796:4:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "13781:20:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "id": 1173, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "Conditional", + "src": "13758:43:0", + "trueExpression": { + "argumentTypes": null, + "id": 1169, + "name": "start", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1141, + "src": "13773:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "13736:65:0" + }, + { + "assignments": [ + 1176 + ], + "declarations": [ + { + "constant": false, + "id": 1176, + "name": "current", + "nodeType": "VariableDeclaration", + "scope": 1222, + "src": "13811:23:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$70_memory_ptr", + "typeString": "struct AllowanceModule.Delegate" + }, + "typeName": { + "contractScope": null, + "id": 1175, + "name": "Delegate", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 70, + "src": "13811:8:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$70_storage_ptr", + "typeString": "struct AllowanceModule.Delegate" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 1182, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1177, + "name": "delegates", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 57, + "src": "13837:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_uint48_$_t_struct$_Delegate_$70_storage_$_$", + "typeString": "mapping(address => mapping(uint48 => struct AllowanceModule.Delegate storage ref))" + } + }, + "id": 1179, + "indexExpression": { + "argumentTypes": null, + "id": 1178, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1139, + "src": "13847:4:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "13837:15:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint48_$_t_struct$_Delegate_$70_storage_$", + "typeString": "mapping(uint48 => struct AllowanceModule.Delegate storage ref)" + } + }, + "id": 1181, + "indexExpression": { + "argumentTypes": null, + "id": 1180, + "name": "initialIndex", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1164, + "src": "13853:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "13837:29:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$70_storage", + "typeString": "struct AllowanceModule.Delegate storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "13811:55:0" + }, + { + "body": { + "id": 1212, + "nodeType": "Block", + "src": "13930:124:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 1198, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1193, + "name": "results", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1147, + "src": "13944:7:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + "id": 1195, + "indexExpression": { + "argumentTypes": null, + "id": 1194, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1160, + "src": "13952:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "13944:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1196, + "name": "current", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1176, + "src": "13957:7:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$70_memory_ptr", + "typeString": "struct AllowanceModule.Delegate memory" + } + }, + "id": 1197, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "delegate", + "nodeType": "MemberAccess", + "referencedDeclaration": 65, + "src": "13957:16:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "13944:29:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 1199, + "nodeType": "ExpressionStatement", + "src": "13944:29:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 1201, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "13987:3:0", + "subExpression": { + "argumentTypes": null, + "id": 1200, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1160, + "src": "13987:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "id": 1202, + "nodeType": "ExpressionStatement", + "src": "13987:3:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 1210, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 1203, + "name": "current", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1176, + "src": "14004:7:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$70_memory_ptr", + "typeString": "struct AllowanceModule.Delegate memory" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1204, + "name": "delegates", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 57, + "src": "14014:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_uint48_$_t_struct$_Delegate_$70_storage_$_$", + "typeString": "mapping(address => mapping(uint48 => struct AllowanceModule.Delegate storage ref))" + } + }, + "id": 1206, + "indexExpression": { + "argumentTypes": null, + "id": 1205, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1139, + "src": "14024:4:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "14014:15:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint48_$_t_struct$_Delegate_$70_storage_$", + "typeString": "mapping(uint48 => struct AllowanceModule.Delegate storage ref)" + } + }, + "id": 1209, + "indexExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1207, + "name": "current", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1176, + "src": "14030:7:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$70_memory_ptr", + "typeString": "struct AllowanceModule.Delegate memory" + } + }, + "id": 1208, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "next", + "nodeType": "MemberAccess", + "referencedDeclaration": 69, + "src": "14030:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "14014:29:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$70_storage", + "typeString": "struct AllowanceModule.Delegate storage ref" + } + }, + "src": "14004:39:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$70_memory_ptr", + "typeString": "struct AllowanceModule.Delegate memory" + } + }, + "id": 1211, + "nodeType": "ExpressionStatement", + "src": "14004:39:0" + } + ] + }, + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 1192, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 1188, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1183, + "name": "current", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1176, + "src": "13882:7:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$70_memory_ptr", + "typeString": "struct AllowanceModule.Delegate memory" + } + }, + "id": 1184, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "delegate", + "nodeType": "MemberAccess", + "referencedDeclaration": 65, + "src": "13882:16:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "hexValue": "30", + "id": 1186, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13910:1:0", + "subdenomination": null, + "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": 1185, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "13902:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 1187, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13902:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "src": "13882:30:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "&&", + "rightExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "id": 1191, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 1189, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1160, + "src": "13916:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "argumentTypes": null, + "id": 1190, + "name": "pageSize", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1143, + "src": "13920:8:0", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "src": "13916:12:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "13882:46:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 1213, + "nodeType": "WhileStatement", + "src": "13876:178:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 1219, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 1214, + "name": "next", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1149, + "src": "14063:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1216, + "name": "current", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1176, + "src": "14077:7:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$70_memory_ptr", + "typeString": "struct AllowanceModule.Delegate memory" + } + }, + "id": 1217, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "delegate", + "nodeType": "MemberAccess", + "referencedDeclaration": 65, + "src": "14077:16:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 1215, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "14070:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint48_$", + "typeString": "type(uint48)" + }, + "typeName": "uint48" + }, + "id": 1218, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "14070:24:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "src": "14063:31:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "id": 1220, + "nodeType": "ExpressionStatement", + "src": "14063:31:0" + }, + { + "externalReferences": [ + { + "results": { + "declaration": 1147, + "isOffset": false, + "isSlot": false, + "src": "14268:7:0", + "valueSize": 1 + } + }, + { + "i": { + "declaration": 1160, + "isOffset": false, + "isSlot": false, + "src": "14277:1:0", + "valueSize": 1 + } + } + ], + "id": 1221, + "nodeType": "InlineAssembly", + "operations": "{ mstore(results, i) }", + "src": "14238:51:0" + } + ] + }, + "documentation": null, + "id": 1223, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getDelegates", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1144, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1139, + "name": "safe", + "nodeType": "VariableDeclaration", + "scope": 1223, + "src": "13558:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1138, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "13558:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1141, + "name": "start", + "nodeType": "VariableDeclaration", + "scope": 1223, + "src": "13572:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + }, + "typeName": { + "id": 1140, + "name": "uint48", + "nodeType": "ElementaryTypeName", + "src": "13572:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1143, + "name": "pageSize", + "nodeType": "VariableDeclaration", + "scope": 1223, + "src": "13586:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "typeName": { + "id": 1142, + "name": "uint8", + "nodeType": "ElementaryTypeName", + "src": "13586:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "13557:44:0" + }, + "returnParameters": { + "id": 1150, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1147, + "name": "results", + "nodeType": "VariableDeclaration", + "scope": 1223, + "src": "13623:24:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[]" + }, + "typeName": { + "baseType": { + "id": 1145, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "13623:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 1146, + "length": null, + "nodeType": "ArrayTypeName", + "src": "13623:9:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1149, + "name": "next", + "nodeType": "VariableDeclaration", + "scope": 1223, + "src": "13649:11:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + }, + "typeName": { + "id": 1148, + "name": "uint48", + "nodeType": "ElementaryTypeName", + "src": "13649:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "13622:39:0" + }, + "scope": 1224, + "src": "13536:759:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + } + ], + "scope": 1225, + "src": "769:13528:0" + } + ], + "src": "0:14297:0" + }, + "legacyAST": { + "absolutePath": "/home/fer/repos/protofire/gnosis/safe-modules/allowances/contracts/AlowanceModule.sol", + "exportedSymbols": { + "AllowanceModule": [ + 1224 + ], + "GnosisSafe": [ + 18 + ] + }, + "id": 1225, + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 1, + "literals": [ + "solidity", + ">=", + "0.5", + ".0", + "<", + "0.7", + ".0" + ], + "nodeType": "PragmaDirective", + "src": "0:31:0" + }, + { + "absolutePath": "@gnosis.pm/safe-contracts/contracts/common/Enum.sol", + "file": "@gnosis.pm/safe-contracts/contracts/common/Enum.sol", + "id": 2, + "nodeType": "ImportDirective", + "scope": 1225, + "sourceUnit": 3236, + "src": "33:61:0", + "symbolAliases": [], + "unitAlias": "" + }, + { + "absolutePath": "@gnosis.pm/safe-contracts/contracts/common/SignatureDecoder.sol", + "file": "@gnosis.pm/safe-contracts/contracts/common/SignatureDecoder.sol", + "id": 3, + "nodeType": "ImportDirective", + "scope": 1225, + "sourceUnit": 3371, + "src": "95:73:0", + "symbolAliases": [], + "unitAlias": "" + }, + { + "absolutePath": "@gnosis.pm/safe-contracts/contracts/interfaces/ISignatureValidator.sol", + "file": "@gnosis.pm/safe-contracts/contracts/interfaces/ISignatureValidator.sol", + "id": 4, + "nodeType": "ImportDirective", + "scope": 1225, + "sourceUnit": 3517, + "src": "169:80:0", + "symbolAliases": [], + "unitAlias": "" + }, + { + "baseContracts": [], + "contractDependencies": [], + "contractKind": "interface", + "documentation": null, + "fullyImplemented": false, + "id": 18, + "linearizedBaseContracts": [ + 18 + ], + "name": "GnosisSafe", + "nodeType": "ContractDefinition", + "nodes": [ + { + "body": null, + "documentation": "@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.", + "id": 17, + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "execTransactionFromModule", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 13, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 6, + "name": "to", + "nodeType": "VariableDeclaration", + "scope": 17, + "src": "643:10:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 5, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "643:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 8, + "name": "value", + "nodeType": "VariableDeclaration", + "scope": 17, + "src": "655:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 7, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "655:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 10, + "name": "data", + "nodeType": "VariableDeclaration", + "scope": 17, + "src": "670:19:0", + "stateVariable": false, + "storageLocation": "calldata", + "typeDescriptions": { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 9, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "670:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 12, + "name": "operation", + "nodeType": "VariableDeclaration", + "scope": 17, + "src": "691:24:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Operation_$3234", + "typeString": "enum Enum.Operation" + }, + "typeName": { + "contractScope": null, + "id": 11, + "name": "Enum.Operation", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 3234, + "src": "691:14:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Operation_$3234", + "typeString": "enum Enum.Operation" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "642:74:0" + }, + "returnParameters": { + "id": 16, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15, + "name": "success", + "nodeType": "VariableDeclaration", + "scope": 17, + "src": "751:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 14, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "751:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "750:14:0" + }, + "scope": 18, + "src": "608:157:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + } + ], + "scope": 1225, + "src": "251:516:0" + }, + { + "baseContracts": [ + { + "arguments": null, + "baseName": { + "contractScope": null, + "id": 19, + "name": "SignatureDecoder", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 3370, + "src": "797:16:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_SignatureDecoder_$3370", + "typeString": "contract SignatureDecoder" + } + }, + "id": 20, + "nodeType": "InheritanceSpecifier", + "src": "797:16:0" + }, + { + "arguments": null, + "baseName": { + "contractScope": null, + "id": 21, + "name": "ISignatureValidatorConstants", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 3504, + "src": "815:28:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_ISignatureValidatorConstants_$3504", + "typeString": "contract ISignatureValidatorConstants" + } + }, + "id": 22, + "nodeType": "InheritanceSpecifier", + "src": "815:28:0" + } + ], + "contractDependencies": [ + 3370, + 3504 + ], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "id": 1224, + "linearizedBaseContracts": [ + 1224, + 3504, + 3370 + ], + "name": "AllowanceModule", + "nodeType": "ContractDefinition", + "nodes": [ + { + "constant": true, + "id": 25, + "name": "NAME", + "nodeType": "VariableDeclaration", + "scope": 1224, + "src": "851:48:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_string_memory", + "typeString": "string" + }, + "typeName": { + "id": 23, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "851:6:0", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "value": { + "argumentTypes": null, + "hexValue": "416c6c6f77616e6365204d6f64756c65", + "id": 24, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "881:18:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_08f58094bad74d8c1150a9739fed54fd2f5fa3e2ab1381a21213c5b33d83bad3", + "typeString": "literal_string \"Allowance Module\"" + }, + "value": "Allowance Module" + }, + "visibility": "public" + }, + { + "constant": true, + "id": 28, + "name": "VERSION", + "nodeType": "VariableDeclaration", + "scope": 1224, + "src": "905:40:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_string_memory", + "typeString": "string" + }, + "typeName": { + "id": 26, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "905:6:0", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "value": { + "argumentTypes": null, + "hexValue": "302e312e30", + "id": 27, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "938:7:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_aa7cdbe2cce2ec7b606b0e199ddd9b264a6e645e767fb8479a7917dcd1b8693f", + "typeString": "literal_string \"0.1.0\"" + }, + "value": "0.1.0" + }, + "visibility": "public" + }, + { + "constant": true, + "id": 31, + "name": "DOMAIN_SEPARATOR_TYPEHASH", + "nodeType": "VariableDeclaration", + "scope": 1224, + "src": "1030:118:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 29, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1030:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": { + "argumentTypes": null, + "hexValue": "307830333561666638336438363933376433356233326530346630646463366666343639323930656566326631623639326438613831356338393430346434373439", + "id": 30, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1082:66:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1517718281442037948617199096126532355110765202990829672390711201829802035017_by_1", + "typeString": "int_const 1517...(68 digits omitted)...5017" + }, + "value": "0x035aff83d86937d35b32e04f0ddc6ff469290eef2f1b692d8a815c89404d4749" + }, + "visibility": "public" + }, + { + "constant": true, + "id": 36, + "name": "ALLOWANCE_TRANSFER_TYPEHASH", + "nodeType": "VariableDeclaration", + "scope": 1224, + "src": "1186:189:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 32, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1186:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "hexValue": "416c6c6f77616e63655472616e73666572286164647265737320736166652c6164647265737320746f6b656e2c75696e74393620616d6f756e742c61646472657373207061796d656e74546f6b656e2c75696e743936207061796d656e742c75696e743136206e6f6e636529", + "id": 34, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1259:110:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_80b006280932094e7cc965863eb5118dc07e5d272c6670c4a7c87299e04fceeb", + "typeString": "literal_string \"AllowanceTransfer(address safe,address token,uint96 amount,address paymentToken,uint96 payment,uint16 nonce)\"" + }, + "value": "AllowanceTransfer(address safe,address token,uint96 amount,address paymentToken,uint96 payment,uint16 nonce)" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_stringliteral_80b006280932094e7cc965863eb5118dc07e5d272c6670c4a7c87299e04fceeb", + "typeString": "literal_string \"AllowanceTransfer(address safe,address token,uint96 amount,address paymentToken,uint96 payment,uint16 nonce)\"" + } + ], + "id": 33, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4971, + "src": "1240:9:0", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 35, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1240:135:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "public" + }, + { + "constant": false, + "id": 44, + "name": "allowances", + "nodeType": "VariableDeclaration", + "scope": 1224, + "src": "1419:88:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_mapping$_t_address_$_t_struct$_Allowance_$81_storage_$_$_$", + "typeString": "mapping(address => mapping(address => mapping(address => struct AllowanceModule.Allowance)))" + }, + "typeName": { + "id": 43, + "keyType": { + "id": 37, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1427:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "1419:70:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_mapping$_t_address_$_t_struct$_Allowance_$81_storage_$_$_$", + "typeString": "mapping(address => mapping(address => mapping(address => struct AllowanceModule.Allowance)))" + }, + "valueType": { + "id": 42, + "keyType": { + "id": 38, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1447:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "1438:50:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_struct$_Allowance_$81_storage_$_$", + "typeString": "mapping(address => mapping(address => struct AllowanceModule.Allowance))" + }, + "valueType": { + "id": 41, + "keyType": { + "id": 39, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1466:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "1458:29:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Allowance_$81_storage_$", + "typeString": "mapping(address => struct AllowanceModule.Allowance)" + }, + "valueType": { + "contractScope": null, + "id": 40, + "name": "Allowance", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 81, + "src": "1477:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_storage_ptr", + "typeString": "struct AllowanceModule.Allowance" + } + } + } + } + }, + "value": null, + "visibility": "public" + }, + { + "constant": false, + "id": 51, + "name": "tokens", + "nodeType": "VariableDeclaration", + "scope": 1224, + "src": "1513: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": 50, + "keyType": { + "id": 45, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1521:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "1513: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": 49, + "keyType": { + "id": 46, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1541:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "1532:30:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_array$_t_address_$dyn_storage_$", + "typeString": "mapping(address => address[])" + }, + "valueType": { + "baseType": { + "id": 47, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1552:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 48, + "length": null, + "nodeType": "ArrayTypeName", + "src": "1552:9:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + } + } + } + }, + "value": null, + "visibility": "public" + }, + { + "constant": false, + "id": 57, + "name": "delegates", + "nodeType": "VariableDeclaration", + "scope": 1224, + "src": "1583:65:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_uint48_$_t_struct$_Delegate_$70_storage_$_$", + "typeString": "mapping(address => mapping(uint48 => struct AllowanceModule.Delegate))" + }, + "typeName": { + "id": 56, + "keyType": { + "id": 52, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1591:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "1583:48:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_uint48_$_t_struct$_Delegate_$70_storage_$_$", + "typeString": "mapping(address => mapping(uint48 => struct AllowanceModule.Delegate))" + }, + "valueType": { + "id": 55, + "keyType": { + "id": 53, + "name": "uint48", + "nodeType": "ElementaryTypeName", + "src": "1611:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "nodeType": "Mapping", + "src": "1602:28:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint48_$_t_struct$_Delegate_$70_storage_$", + "typeString": "mapping(uint48 => struct AllowanceModule.Delegate)" + }, + "valueType": { + "contractScope": null, + "id": 54, + "name": "Delegate", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 70, + "src": "1621:8:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$70_storage_ptr", + "typeString": "struct AllowanceModule.Delegate" + } + } + } + }, + "value": null, + "visibility": "public" + }, + { + "constant": false, + "id": 61, + "name": "delegatesStart", + "nodeType": "VariableDeclaration", + "scope": 1224, + "src": "1654:48:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint48_$", + "typeString": "mapping(address => uint48)" + }, + "typeName": { + "id": 60, + "keyType": { + "id": 58, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1662:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "1654:26:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint48_$", + "typeString": "mapping(address => uint48)" + }, + "valueType": { + "id": 59, + "name": "uint48", + "nodeType": "ElementaryTypeName", + "src": "1673:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + } + }, + "value": null, + "visibility": "public" + }, + { + "constant": false, + "id": 63, + "name": "domainSeparator", + "nodeType": "VariableDeclaration", + "scope": 1224, + "src": "1708:30:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 62, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1708:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "public" + }, + { + "canonicalName": "AllowanceModule.Delegate", + "id": 70, + "members": [ + { + "constant": false, + "id": 65, + "name": "delegate", + "nodeType": "VariableDeclaration", + "scope": 70, + "src": "1771:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 64, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1771:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 67, + "name": "prev", + "nodeType": "VariableDeclaration", + "scope": 70, + "src": "1797:11:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + }, + "typeName": { + "id": 66, + "name": "uint48", + "nodeType": "ElementaryTypeName", + "src": "1797:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 69, + "name": "next", + "nodeType": "VariableDeclaration", + "scope": 70, + "src": "1818:11:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + }, + "typeName": { + "id": 68, + "name": "uint48", + "nodeType": "ElementaryTypeName", + "src": "1818:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "value": null, + "visibility": "internal" + } + ], + "name": "Delegate", + "nodeType": "StructDefinition", + "scope": 1224, + "src": "1745:91:0", + "visibility": "public" + }, + { + "canonicalName": "AllowanceModule.Allowance", + "id": 81, + "members": [ + { + "constant": false, + "id": 72, + "name": "amount", + "nodeType": "VariableDeclaration", + "scope": 81, + "src": "1869:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "typeName": { + "id": 71, + "name": "uint96", + "nodeType": "ElementaryTypeName", + "src": "1869:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 74, + "name": "spent", + "nodeType": "VariableDeclaration", + "scope": 81, + "src": "1892:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "typeName": { + "id": 73, + "name": "uint96", + "nodeType": "ElementaryTypeName", + "src": "1892:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 76, + "name": "resetTimeMin", + "nodeType": "VariableDeclaration", + "scope": 81, + "src": "1914:19:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + }, + "typeName": { + "id": 75, + "name": "uint16", + "nodeType": "ElementaryTypeName", + "src": "1914:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 78, + "name": "lastResetMin", + "nodeType": "VariableDeclaration", + "scope": 81, + "src": "1985:19:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 77, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "1985:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 80, + "name": "nonce", + "nodeType": "VariableDeclaration", + "scope": 81, + "src": "2014:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + }, + "typeName": { + "id": 79, + "name": "uint16", + "nodeType": "ElementaryTypeName", + "src": "2014:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "value": null, + "visibility": "internal" + } + ], + "name": "Allowance", + "nodeType": "StructDefinition", + "scope": 1224, + "src": "1842:191:0", + "visibility": "public" + }, + { + "anonymous": false, + "documentation": null, + "id": 87, + "name": "AddDelegate", + "nodeType": "EventDefinition", + "parameters": { + "id": 86, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 83, + "indexed": true, + "name": "safe", + "nodeType": "VariableDeclaration", + "scope": 87, + "src": "2057:20:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 82, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2057:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 85, + "indexed": false, + "name": "delegate", + "nodeType": "VariableDeclaration", + "scope": 87, + "src": "2079:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 84, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2079:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "2056:40:0" + }, + "src": "2039:58:0" + }, + { + "anonymous": false, + "documentation": null, + "id": 93, + "name": "RemoveDelegate", + "nodeType": "EventDefinition", + "parameters": { + "id": 92, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 89, + "indexed": true, + "name": "safe", + "nodeType": "VariableDeclaration", + "scope": 93, + "src": "2123:20:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 88, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2123:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 91, + "indexed": false, + "name": "delegate", + "nodeType": "VariableDeclaration", + "scope": 93, + "src": "2145:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 90, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2145:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "2122:40:0" + }, + "src": "2102:61:0" + }, + { + "anonymous": false, + "documentation": null, + "id": 107, + "name": "ExecuteAllowanceTransfer", + "nodeType": "EventDefinition", + "parameters": { + "id": 106, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 95, + "indexed": true, + "name": "safe", + "nodeType": "VariableDeclaration", + "scope": 107, + "src": "2199:20:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 94, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2199:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 97, + "indexed": false, + "name": "delegate", + "nodeType": "VariableDeclaration", + "scope": 107, + "src": "2221:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 96, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2221:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 99, + "indexed": false, + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 107, + "src": "2239:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 98, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2239:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 101, + "indexed": false, + "name": "to", + "nodeType": "VariableDeclaration", + "scope": 107, + "src": "2254:10:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 100, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2254:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 103, + "indexed": false, + "name": "value", + "nodeType": "VariableDeclaration", + "scope": 107, + "src": "2266:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "typeName": { + "id": 102, + "name": "uint96", + "nodeType": "ElementaryTypeName", + "src": "2266:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 105, + "indexed": false, + "name": "nonce", + "nodeType": "VariableDeclaration", + "scope": 107, + "src": "2280:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + }, + "typeName": { + "id": 104, + "name": "uint16", + "nodeType": "ElementaryTypeName", + "src": "2280:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "2198:95:0" + }, + "src": "2168:126:0" + }, + { + "anonymous": false, + "documentation": null, + "id": 119, + "name": "SetAllowance", + "nodeType": "EventDefinition", + "parameters": { + "id": 118, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 109, + "indexed": true, + "name": "safe", + "nodeType": "VariableDeclaration", + "scope": 119, + "src": "2318:20:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 108, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2318:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 111, + "indexed": false, + "name": "delegate", + "nodeType": "VariableDeclaration", + "scope": 119, + "src": "2340:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 110, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2340:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 113, + "indexed": false, + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 119, + "src": "2358:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 112, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2358:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 115, + "indexed": false, + "name": "allowanceAmount", + "nodeType": "VariableDeclaration", + "scope": 119, + "src": "2373:22:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "typeName": { + "id": 114, + "name": "uint96", + "nodeType": "ElementaryTypeName", + "src": "2373:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 117, + "indexed": false, + "name": "resetTime", + "nodeType": "VariableDeclaration", + "scope": 119, + "src": "2397:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + }, + "typeName": { + "id": 116, + "name": "uint16", + "nodeType": "ElementaryTypeName", + "src": "2397:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "2317:97:0" + }, + "src": "2299:116:0" + }, + { + "body": { + "id": 132, + "nodeType": "Block", + "src": "2442:119:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 130, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 122, + "name": "domainSeparator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 63, + "src": "2482:15:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 126, + "name": "DOMAIN_SEPARATOR_TYPEHASH", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 31, + "src": "2521:25:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "argumentTypes": null, + "id": 127, + "name": "this", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5001, + "src": "2548:4:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_AllowanceModule_$1224", + "typeString": "contract AllowanceModule" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_contract$_AllowanceModule_$1224", + "typeString": "contract AllowanceModule" + } + ], + "expression": { + "argumentTypes": null, + "id": 124, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4964, + "src": "2510:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 125, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encode", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2510:10:0", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencode_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 128, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2510:43:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 123, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4971, + "src": "2500:9:0", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 129, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2500:54:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "src": "2482:72:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "id": 131, + "nodeType": "ExpressionStatement", + "src": "2482:72:0" + } + ] + }, + "documentation": null, + "id": 133, + "implemented": true, + "kind": "constructor", + "modifiers": [], + "name": "", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 120, + "nodeType": "ParameterList", + "parameters": [], + "src": "2432:2:0" + }, + "returnParameters": { + "id": 121, + "nodeType": "ParameterList", + "parameters": [], + "src": "2442:0:0" + }, + "scope": 1224, + "src": "2421:140:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 267, + "nodeType": "Block", + "src": "3153:1171:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 157, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 147, + "name": "delegates", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 57, + "src": "3171:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_uint48_$_t_struct$_Delegate_$70_storage_$_$", + "typeString": "mapping(address => mapping(uint48 => struct AllowanceModule.Delegate storage ref))" + } + }, + "id": 150, + "indexExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 148, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4977, + "src": "3181:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 149, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3181:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3171:21:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint48_$_t_struct$_Delegate_$70_storage_$", + "typeString": "mapping(uint48 => struct AllowanceModule.Delegate storage ref)" + } + }, + "id": 154, + "indexExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 152, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 135, + "src": "3200:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 151, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "3193:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint48_$", + "typeString": "type(uint48)" + }, + "typeName": "uint48" + }, + "id": 153, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3193:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3171:39:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$70_storage", + "typeString": "struct AllowanceModule.Delegate storage ref" + } + }, + "id": 155, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "delegate", + "nodeType": "MemberAccess", + "referencedDeclaration": 65, + "src": "3171:48:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "id": 156, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 135, + "src": "3223:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "3171:60:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "64656c6567617465735b6d73672e73656e6465725d5b75696e7434382864656c6567617465295d2e64656c6567617465203d3d2064656c6567617465", + "id": 158, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3233:62:0", + "subdenomination": null, + "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": 146, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 4980, + 4981 + ], + "referencedDeclaration": 4981, + "src": "3163:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 159, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3163:133:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 160, + "nodeType": "ExpressionStatement", + "src": "3163:133:0" + }, + { + "assignments": [ + 162 + ], + "declarations": [ + { + "constant": false, + "id": 162, + "name": "allowance", + "nodeType": "VariableDeclaration", + "scope": 267, + "src": "3306:26:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance" + }, + "typeName": { + "contractScope": null, + "id": 161, + "name": "Allowance", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 81, + "src": "3306:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_storage_ptr", + "typeString": "struct AllowanceModule.Allowance" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 169, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 164, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4977, + "src": "3348:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 165, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3348:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 166, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 135, + "src": "3360:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 167, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 137, + "src": "3370: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": 163, + "name": "getAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 336, + "src": "3335:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_address_$_t_address_$_t_address_$returns$_t_struct$_Allowance_$81_memory_ptr_$", + "typeString": "function (address,address,address) view returns (struct AllowanceModule.Allowance memory)" + } + }, + "id": 168, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3335:41:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "3306:70:0" + }, + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + }, + "id": 173, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 170, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 162, + "src": "3390:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 171, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "nonce", + "nodeType": "MemberAccess", + "referencedDeclaration": 80, + "src": "3390:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 172, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3409:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "3390:20:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 191, + "nodeType": "IfStatement", + "src": "3386:210:0", + "trueBody": { + "id": 190, + "nodeType": "Block", + "src": "3412:184:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 178, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 174, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 162, + "src": "3512:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 176, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "nonce", + "nodeType": "MemberAccess", + "referencedDeclaration": 80, + "src": "3512:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "31", + "id": 177, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3530:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "3512:19:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "id": 179, + "nodeType": "ExpressionStatement", + "src": "3512:19:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 187, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 137, + "src": "3579:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 180, + "name": "tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 51, + "src": "3545: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": 184, + "indexExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 181, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4977, + "src": "3552:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 182, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3552:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3545:18:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_array$_t_address_$dyn_storage_$", + "typeString": "mapping(address => address[] storage ref)" + } + }, + "id": 185, + "indexExpression": { + "argumentTypes": null, + "id": 183, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 135, + "src": "3564:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3545:28:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 186, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "push", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3545:33:0", + "typeDescriptions": { + "typeIdentifier": "t_function_arraypush_nonpayable$_t_address_$returns$_t_uint256_$", + "typeString": "function (address) returns (uint256)" + } + }, + "id": 188, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3545:40:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 189, + "nodeType": "ExpressionStatement", + "src": "3545:40:0" + } + ] + } + }, + { + "assignments": [ + 193 + ], + "declarations": [ + { + "constant": false, + "id": 193, + "name": "currentMin", + "nodeType": "VariableDeclaration", + "scope": 267, + "src": "3722:17:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 192, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "3722:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 199, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 197, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 195, + "name": "now", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4979, + "src": "3749:3:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "/", + "rightExpression": { + "argumentTypes": null, + "hexValue": "3630", + "id": 196, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3755:2:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_60_by_1", + "typeString": "int_const 60" + }, + "value": "60" + }, + "src": "3749:8:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 194, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "3742:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint32_$", + "typeString": "type(uint32)" + }, + "typeName": "uint32" + }, + "id": 198, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3742:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "3722:36:0" + }, + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "id": 202, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 200, + "name": "resetBaseMin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 143, + "src": "3772:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 201, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3787:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "3772:16:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "id": 228, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 225, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 162, + "src": "3986:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 226, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "lastResetMin", + "nodeType": "MemberAccess", + "referencedDeclaration": 78, + "src": "3986:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 227, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4012:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "3986:27:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 236, + "nodeType": "IfStatement", + "src": "3982:93:0", + "trueBody": { + "id": 235, + "nodeType": "Block", + "src": "4015:60:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 233, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 229, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 162, + "src": "4029:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 231, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "lastResetMin", + "nodeType": "MemberAccess", + "referencedDeclaration": 78, + "src": "4029:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 232, + "name": "currentMin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 193, + "src": "4054:10:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "src": "4029:35:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "id": 234, + "nodeType": "ExpressionStatement", + "src": "4029:35:0" + } + ] + } + }, + "id": 237, + "nodeType": "IfStatement", + "src": "3768:307:0", + "trueBody": { + "id": 224, + "nodeType": "Block", + "src": "3790:186:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "id": 206, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 204, + "name": "resetBaseMin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 143, + "src": "3812:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "id": 205, + "name": "currentMin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 193, + "src": "3828:10:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "src": "3812:26:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "7265736574426173654d696e203c3d2063757272656e744d696e", + "id": 207, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3840:28:0", + "subdenomination": null, + "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": 203, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 4980, + 4981 + ], + "referencedDeclaration": 4981, + "src": "3804:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 208, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3804:65:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 209, + "nodeType": "ExpressionStatement", + "src": "3804:65:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 222, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 210, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 162, + "src": "3883:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 212, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "lastResetMin", + "nodeType": "MemberAccess", + "referencedDeclaration": 78, + "src": "3883:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "id": 221, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 213, + "name": "currentMin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 193, + "src": "3908:10:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "argumentTypes": null, + "components": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "id": 219, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "components": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "id": 216, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 214, + "name": "currentMin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 193, + "src": "3923:10:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "argumentTypes": null, + "id": 215, + "name": "resetBaseMin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 143, + "src": "3936:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "src": "3923:25:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + } + ], + "id": 217, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "3922:27:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "BinaryOperation", + "operator": "%", + "rightExpression": { + "argumentTypes": null, + "id": 218, + "name": "resetTimeMin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 141, + "src": "3952:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "src": "3922:42:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + } + ], + "id": 220, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "3921:44:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "src": "3908:57:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "src": "3883:82:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "id": 223, + "nodeType": "ExpressionStatement", + "src": "3883:82:0" + } + ] + } + }, + { + "expression": { + "argumentTypes": null, + "id": 242, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 238, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 162, + "src": "4084:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 240, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "resetTimeMin", + "nodeType": "MemberAccess", + "referencedDeclaration": 76, + "src": "4084:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 241, + "name": "resetTimeMin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 141, + "src": "4109:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "src": "4084:37:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "id": 243, + "nodeType": "ExpressionStatement", + "src": "4084:37:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 248, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 244, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 162, + "src": "4131:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 246, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "amount", + "nodeType": "MemberAccess", + "referencedDeclaration": 72, + "src": "4131:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 247, + "name": "allowanceAmount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 139, + "src": "4150:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "src": "4131:34:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "id": 249, + "nodeType": "ExpressionStatement", + "src": "4131:34:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 251, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4977, + "src": "4191:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 252, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "4191:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 253, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 135, + "src": "4203:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 254, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 137, + "src": "4213:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 255, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 162, + "src": "4220:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_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_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + ], + "id": 250, + "name": "updateAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 358, + "src": "4175:15:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_address_$_t_struct$_Allowance_$81_memory_ptr_$returns$__$", + "typeString": "function (address,address,address,struct AllowanceModule.Allowance memory)" + } + }, + "id": 256, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4175:55:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 257, + "nodeType": "ExpressionStatement", + "src": "4175:55:0" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 259, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4977, + "src": "4258:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 260, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "4258:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 261, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 135, + "src": "4270:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 262, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 137, + "src": "4280:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 263, + "name": "allowanceAmount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 139, + "src": "4287:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + { + "argumentTypes": null, + "id": 264, + "name": "resetTimeMin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 141, + "src": "4304: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": 258, + "name": "SetAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 119, + "src": "4245: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": 265, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4245:72:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 266, + "nodeType": "EmitStatement", + "src": "4240:77:0" + } + ] + }, + "documentation": "@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", + "id": 268, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "setAllowance", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 144, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 135, + "name": "delegate", + "nodeType": "VariableDeclaration", + "scope": 268, + "src": "3035:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 134, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3035:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 137, + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 268, + "src": "3053:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 136, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3053:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 139, + "name": "allowanceAmount", + "nodeType": "VariableDeclaration", + "scope": 268, + "src": "3068:22:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "typeName": { + "id": 138, + "name": "uint96", + "nodeType": "ElementaryTypeName", + "src": "3068:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 141, + "name": "resetTimeMin", + "nodeType": "VariableDeclaration", + "scope": 268, + "src": "3092:19:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + }, + "typeName": { + "id": 140, + "name": "uint16", + "nodeType": "ElementaryTypeName", + "src": "3092:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 143, + "name": "resetBaseMin", + "nodeType": "VariableDeclaration", + "scope": 268, + "src": "3113:19:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 142, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "3113:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "3034:99:0" + }, + "returnParameters": { + "id": 145, + "nodeType": "ParameterList", + "parameters": [], + "src": "3153:0:0" + }, + "scope": 1224, + "src": "3013:1311:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 335, + "nodeType": "Block", + "src": "4449:462:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 287, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 279, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 277, + "src": "4459:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 280, + "name": "allowances", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 44, + "src": "4471:10:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_mapping$_t_address_$_t_struct$_Allowance_$81_storage_$_$_$", + "typeString": "mapping(address => mapping(address => mapping(address => struct AllowanceModule.Allowance storage ref)))" + } + }, + "id": 282, + "indexExpression": { + "argumentTypes": null, + "id": 281, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 270, + "src": "4482:4:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "4471:16:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_struct$_Allowance_$81_storage_$_$", + "typeString": "mapping(address => mapping(address => struct AllowanceModule.Allowance storage ref))" + } + }, + "id": 284, + "indexExpression": { + "argumentTypes": null, + "id": 283, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 272, + "src": "4488:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "4471:26:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Allowance_$81_storage_$", + "typeString": "mapping(address => struct AllowanceModule.Allowance storage ref)" + } + }, + "id": 286, + "indexExpression": { + "argumentTypes": null, + "id": 285, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 274, + "src": "4498:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "4471:33:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_storage", + "typeString": "struct AllowanceModule.Allowance storage ref" + } + }, + "src": "4459:45:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 288, + "nodeType": "ExpressionStatement", + "src": "4459:45:0" + }, + { + "assignments": [ + 290 + ], + "declarations": [ + { + "constant": false, + "id": 290, + "name": "currentMin", + "nodeType": "VariableDeclaration", + "scope": 335, + "src": "4576:17:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 289, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "4576:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 296, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 294, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 292, + "name": "now", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4979, + "src": "4603:3:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "/", + "rightExpression": { + "argumentTypes": null, + "hexValue": "3630", + "id": 293, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4609:2:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_60_by_1", + "typeString": "int_const 60" + }, + "value": "60" + }, + "src": "4603:8:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 291, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "4596:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint32_$", + "typeString": "type(uint32)" + }, + "typeName": "uint32" + }, + "id": 295, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4596:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "4576:36:0" + }, + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 308, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + }, + "id": 300, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 297, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 277, + "src": "4626:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 298, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "resetTimeMin", + "nodeType": "MemberAccess", + "referencedDeclaration": 76, + "src": "4626:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 299, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4651:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "4626:26:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "&&", + "rightExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "id": 307, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 301, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 277, + "src": "4656:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 302, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "lastResetMin", + "nodeType": "MemberAccess", + "referencedDeclaration": 78, + "src": "4656:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "id": 306, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 303, + "name": "currentMin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 290, + "src": "4682:10:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 304, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 277, + "src": "4695:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 305, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "resetTimeMin", + "nodeType": "MemberAccess", + "referencedDeclaration": 76, + "src": "4695:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "src": "4682:35:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "src": "4656:61:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "4626:91:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 332, + "nodeType": "IfStatement", + "src": "4622:257:0", + "trueBody": { + "id": 331, + "nodeType": "Block", + "src": "4719:160:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 313, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 309, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 277, + "src": "4733:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 311, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "spent", + "nodeType": "MemberAccess", + "referencedDeclaration": 74, + "src": "4733:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "30", + "id": 312, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4751:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "4733:19:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "id": 314, + "nodeType": "ExpressionStatement", + "src": "4733:19:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 329, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 315, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 277, + "src": "4766:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 317, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "lastResetMin", + "nodeType": "MemberAccess", + "referencedDeclaration": 78, + "src": "4766:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "id": 328, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 318, + "name": "currentMin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 290, + "src": "4791:10:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "argumentTypes": null, + "components": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "id": 326, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "components": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "id": 322, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 319, + "name": "currentMin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 290, + "src": "4806:10:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 320, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 277, + "src": "4819:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 321, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "lastResetMin", + "nodeType": "MemberAccess", + "referencedDeclaration": 78, + "src": "4819:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "src": "4806:35:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + } + ], + "id": 323, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "4805:37:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "BinaryOperation", + "operator": "%", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 324, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 277, + "src": "4845:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 325, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "resetTimeMin", + "nodeType": "MemberAccess", + "referencedDeclaration": 76, + "src": "4845:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "src": "4805:62:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + } + ], + "id": 327, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "4804:64:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "src": "4791:77:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "src": "4766:102:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "id": 330, + "nodeType": "ExpressionStatement", + "src": "4766:102:0" + } + ] + } + }, + { + "expression": { + "argumentTypes": null, + "id": 333, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 277, + "src": "4895:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "functionReturnParameters": 278, + "id": 334, + "nodeType": "Return", + "src": "4888:16:0" + } + ] + }, + "documentation": null, + "id": 336, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getAllowance", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 275, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 270, + "name": "safe", + "nodeType": "VariableDeclaration", + "scope": 336, + "src": "4352:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 269, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4352:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 272, + "name": "delegate", + "nodeType": "VariableDeclaration", + "scope": 336, + "src": "4366:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 271, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4366:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 274, + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 336, + "src": "4384:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 273, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4384:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "4351:47:0" + }, + "returnParameters": { + "id": 278, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 277, + "name": "allowance", + "nodeType": "VariableDeclaration", + "scope": 336, + "src": "4421:26:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance" + }, + "typeName": { + "contractScope": null, + "id": 276, + "name": "Allowance", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 81, + "src": "4421:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_storage_ptr", + "typeString": "struct AllowanceModule.Allowance" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "4420:28:0" + }, + "scope": 1224, + "src": "4330:581:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "private" + }, + { + "body": { + "id": 357, + "nodeType": "Block", + "src": "5025:62:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 355, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 347, + "name": "allowances", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 44, + "src": "5035:10:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_mapping$_t_address_$_t_struct$_Allowance_$81_storage_$_$_$", + "typeString": "mapping(address => mapping(address => mapping(address => struct AllowanceModule.Allowance storage ref)))" + } + }, + "id": 351, + "indexExpression": { + "argumentTypes": null, + "id": 348, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 338, + "src": "5046:4:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "5035:16:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_struct$_Allowance_$81_storage_$_$", + "typeString": "mapping(address => mapping(address => struct AllowanceModule.Allowance storage ref))" + } + }, + "id": 352, + "indexExpression": { + "argumentTypes": null, + "id": 349, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 340, + "src": "5052:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "5035:26:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Allowance_$81_storage_$", + "typeString": "mapping(address => struct AllowanceModule.Allowance storage ref)" + } + }, + "id": 353, + "indexExpression": { + "argumentTypes": null, + "id": 350, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 342, + "src": "5062:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "5035:33:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_storage", + "typeString": "struct AllowanceModule.Allowance storage ref" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 354, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 344, + "src": "5071:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "src": "5035:45:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_storage", + "typeString": "struct AllowanceModule.Allowance storage ref" + } + }, + "id": 356, + "nodeType": "ExpressionStatement", + "src": "5035:45:0" + } + ] + }, + "documentation": null, + "id": 358, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "updateAllowance", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 345, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 338, + "name": "safe", + "nodeType": "VariableDeclaration", + "scope": 358, + "src": "4942:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 337, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4942:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 340, + "name": "delegate", + "nodeType": "VariableDeclaration", + "scope": 358, + "src": "4956:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 339, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4956:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 342, + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 358, + "src": "4974:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 341, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4974:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 344, + "name": "allowance", + "nodeType": "VariableDeclaration", + "scope": 358, + "src": "4989:26:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance" + }, + "typeName": { + "contractScope": null, + "id": 343, + "name": "Allowance", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 81, + "src": "4989:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_storage_ptr", + "typeString": "struct AllowanceModule.Allowance" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "4941:75:0" + }, + "returnParameters": { + "id": 346, + "nodeType": "ParameterList", + "parameters": [], + "src": "5025:0:0" + }, + "scope": 1224, + "src": "4917:170:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "private" + }, + { + "body": { + "id": 388, + "nodeType": "Block", + "src": "5157:181:0", + "statements": [ + { + "assignments": [ + 366 + ], + "declarations": [ + { + "constant": false, + "id": 366, + "name": "allowance", + "nodeType": "VariableDeclaration", + "scope": 388, + "src": "5167:26:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance" + }, + "typeName": { + "contractScope": null, + "id": 365, + "name": "Allowance", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 81, + "src": "5167:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_storage_ptr", + "typeString": "struct AllowanceModule.Allowance" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 373, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 368, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4977, + "src": "5209:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 369, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "5209:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 370, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 360, + "src": "5221:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 371, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 362, + "src": "5231: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": 367, + "name": "getAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 336, + "src": "5196:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_address_$_t_address_$_t_address_$returns$_t_struct$_Allowance_$81_memory_ptr_$", + "typeString": "function (address,address,address) view returns (struct AllowanceModule.Allowance memory)" + } + }, + "id": 372, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5196:41:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "5167:70:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 378, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 374, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 366, + "src": "5247:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 376, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "spent", + "nodeType": "MemberAccess", + "referencedDeclaration": 74, + "src": "5247:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "30", + "id": 377, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "5265:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "5247:19:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "id": 379, + "nodeType": "ExpressionStatement", + "src": "5247:19:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 381, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4977, + "src": "5292:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 382, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "5292:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 383, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 360, + "src": "5304:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 384, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 362, + "src": "5314:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 385, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 366, + "src": "5321:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_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_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + ], + "id": 380, + "name": "updateAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 358, + "src": "5276:15:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_address_$_t_struct$_Allowance_$81_memory_ptr_$returns$__$", + "typeString": "function (address,address,address,struct AllowanceModule.Allowance memory)" + } + }, + "id": 386, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5276:55:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 387, + "nodeType": "ExpressionStatement", + "src": "5276:55:0" + } + ] + }, + "documentation": null, + "id": 389, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "resetAllowance", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 363, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 360, + "name": "delegate", + "nodeType": "VariableDeclaration", + "scope": 389, + "src": "5117:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 359, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5117:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 362, + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 389, + "src": "5135:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 361, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5135:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5116:33:0" + }, + "returnParameters": { + "id": 364, + "nodeType": "ParameterList", + "parameters": [], + "src": "5157:0:0" + }, + "scope": 1224, + "src": "5093:245:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 577, + "nodeType": "Block", + "src": "5602:1988:0", + "statements": [ + { + "assignments": [ + 409 + ], + "declarations": [ + { + "constant": false, + "id": 409, + "name": "allowance", + "nodeType": "VariableDeclaration", + "scope": 577, + "src": "5641:26:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance" + }, + "typeName": { + "contractScope": null, + "id": 408, + "name": "Allowance", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 81, + "src": "5641:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_storage_ptr", + "typeString": "struct AllowanceModule.Allowance" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 417, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 412, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 391, + "src": "5691:4:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + ], + "id": 411, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "5683:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 413, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5683:13:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 414, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 403, + "src": "5698:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 415, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 393, + "src": "5708: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": 410, + "name": "getAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 336, + "src": "5670:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_address_$_t_address_$_t_address_$returns$_t_struct$_Allowance_$81_memory_ptr_$", + "typeString": "function (address,address,address) view returns (struct AllowanceModule.Allowance memory)" + } + }, + "id": 416, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5670:44:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "5641:73:0" + }, + { + "assignments": [ + 419 + ], + "declarations": [ + { + "constant": false, + "id": 419, + "name": "transferHashData", + "nodeType": "VariableDeclaration", + "scope": 577, + "src": "5724:29:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 418, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "5724:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 432, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 422, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 391, + "src": "5789:4:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + ], + "id": 421, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "5781:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 423, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5781:13:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 424, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 393, + "src": "5796:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 425, + "name": "to", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 395, + "src": "5803:2:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 426, + "name": "amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 397, + "src": "5807:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + { + "argumentTypes": null, + "id": 427, + "name": "paymentToken", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 399, + "src": "5815:12:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 428, + "name": "payment", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 401, + "src": "5829:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 429, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 409, + "src": "5838:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 430, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "nonce", + "nodeType": "MemberAccess", + "referencedDeclaration": 80, + "src": "5838: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": 420, + "name": "generateTransferHashData", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 626, + "src": "5756: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": 431, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5756:98:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "5724:130:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 440, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 433, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 409, + "src": "5897:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 435, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "nonce", + "nodeType": "MemberAccess", + "referencedDeclaration": 80, + "src": "5897:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + }, + "id": 439, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 436, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 409, + "src": "5915:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 437, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "nonce", + "nodeType": "MemberAccess", + "referencedDeclaration": 80, + "src": "5915:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 438, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "5933:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "5915:19:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "src": "5897:37:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "id": 441, + "nodeType": "ExpressionStatement", + "src": "5897:37:0" + }, + { + "assignments": [ + 443 + ], + "declarations": [ + { + "constant": false, + "id": 443, + "name": "newSpent", + "nodeType": "VariableDeclaration", + "scope": 577, + "src": "5944:15:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "typeName": { + "id": 442, + "name": "uint96", + "nodeType": "ElementaryTypeName", + "src": "5944:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 448, + "initialValue": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "id": 447, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 444, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 409, + "src": "5962:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 445, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "spent", + "nodeType": "MemberAccess", + "referencedDeclaration": 74, + "src": "5962:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "argumentTypes": null, + "id": 446, + "name": "amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 397, + "src": "5980:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "src": "5962:24:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "5944:42:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 458, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "id": 453, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 450, + "name": "newSpent", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 443, + "src": "6051:8:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 451, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 409, + "src": "6062:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 452, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "spent", + "nodeType": "MemberAccess", + "referencedDeclaration": 74, + "src": "6062:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "src": "6051:26:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "&&", + "rightExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "id": 457, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 454, + "name": "newSpent", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 443, + "src": "6081:8:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 455, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 409, + "src": "6093:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 456, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "amount", + "nodeType": "MemberAccess", + "referencedDeclaration": 72, + "src": "6093:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "src": "6081:28:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "6051:58:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "6e65775370656e74203e20616c6c6f77616e63652e7370656e74202626206e65775370656e74203c3d20616c6c6f77616e63652e616d6f756e74", + "id": 459, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6111:60:0", + "subdenomination": null, + "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": 449, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 4980, + 4981 + ], + "referencedDeclaration": 4981, + "src": "6043:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 460, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6043:129:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 461, + "nodeType": "ExpressionStatement", + "src": "6043:129:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 466, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 462, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 409, + "src": "6182:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 464, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "spent", + "nodeType": "MemberAccess", + "referencedDeclaration": 74, + "src": "6182:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 465, + "name": "newSpent", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 443, + "src": "6200:8:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "src": "6182:26:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "id": 467, + "nodeType": "ExpressionStatement", + "src": "6182:26:0" + }, + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "id": 470, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 468, + "name": "payment", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 401, + "src": "6222:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 469, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6232:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "6222:11:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 526, + "nodeType": "IfStatement", + "src": "6218:748:0", + "trueBody": { + "id": 525, + "nodeType": "Block", + "src": "6235:731:0", + "statements": [ + { + "assignments": [ + 472 + ], + "declarations": [ + { + "constant": false, + "id": 472, + "name": "paymentAllowance", + "nodeType": "VariableDeclaration", + "scope": 525, + "src": "6325:33:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance" + }, + "typeName": { + "contractScope": null, + "id": 471, + "name": "Allowance", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 81, + "src": "6325:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_storage_ptr", + "typeString": "struct AllowanceModule.Allowance" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 485, + "initialValue": { + "argumentTypes": null, + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 475, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 473, + "name": "paymentToken", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 399, + "src": "6361:12:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "id": 474, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 393, + "src": "6377:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "6361:21:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 479, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 391, + "src": "6418:4:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + ], + "id": 478, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "6410:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 480, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6410:13:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 481, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 403, + "src": "6425:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 482, + "name": "paymentToken", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 399, + "src": "6435: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": 477, + "name": "getAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 336, + "src": "6397:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_address_$_t_address_$_t_address_$returns$_t_struct$_Allowance_$81_memory_ptr_$", + "typeString": "function (address,address,address) view returns (struct AllowanceModule.Allowance memory)" + } + }, + "id": 483, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6397:51:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 484, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "Conditional", + "src": "6361:87:0", + "trueExpression": { + "argumentTypes": null, + "id": 476, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 409, + "src": "6385:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "6325:123:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 491, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 486, + "name": "newSpent", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 443, + "src": "6462:8:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "id": 490, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 487, + "name": "paymentAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 472, + "src": "6473:16:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 488, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "spent", + "nodeType": "MemberAccess", + "referencedDeclaration": 74, + "src": "6473:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "argumentTypes": null, + "id": 489, + "name": "payment", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 401, + "src": "6498:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "src": "6473:32:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "src": "6462:43:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "id": 492, + "nodeType": "ExpressionStatement", + "src": "6462:43:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 502, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "id": 497, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 494, + "name": "newSpent", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 443, + "src": "6578:8:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 495, + "name": "paymentAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 472, + "src": "6589:16:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 496, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "spent", + "nodeType": "MemberAccess", + "referencedDeclaration": 74, + "src": "6589:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "src": "6578:33:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "&&", + "rightExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "id": 501, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 498, + "name": "newSpent", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 443, + "src": "6615:8:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 499, + "name": "paymentAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 472, + "src": "6627:16:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 500, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "amount", + "nodeType": "MemberAccess", + "referencedDeclaration": 72, + "src": "6627:23:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "src": "6615:35:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "6578:72:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "6e65775370656e74203e207061796d656e74416c6c6f77616e63652e7370656e74202626206e65775370656e74203c3d207061796d656e74416c6c6f77616e63652e616d6f756e74", + "id": 503, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6652:74:0", + "subdenomination": null, + "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": 493, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 4980, + 4981 + ], + "referencedDeclaration": 4981, + "src": "6570:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 504, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6570:157:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 505, + "nodeType": "ExpressionStatement", + "src": "6570:157:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 510, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 506, + "name": "paymentAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 472, + "src": "6741:16:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 508, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "spent", + "nodeType": "MemberAccess", + "referencedDeclaration": 74, + "src": "6741:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 509, + "name": "newSpent", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 443, + "src": "6766:8:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "src": "6741:33:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "id": 511, + "nodeType": "ExpressionStatement", + "src": "6741:33:0" + }, + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 514, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 512, + "name": "paymentToken", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 399, + "src": "6860:12:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "argumentTypes": null, + "id": 513, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 393, + "src": "6876:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "6860:21:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 524, + "nodeType": "IfStatement", + "src": "6856:99:0", + "trueBody": { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 517, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 391, + "src": "6907:4:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + ], + "id": 516, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "6899:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 518, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6899:13:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 519, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 403, + "src": "6914:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 520, + "name": "paymentToken", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 399, + "src": "6924:12:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 521, + "name": "paymentAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 472, + "src": "6938:16:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_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_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + ], + "id": 515, + "name": "updateAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 358, + "src": "6883:15:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_address_$_t_struct$_Allowance_$81_memory_ptr_$returns$__$", + "typeString": "function (address,address,address,struct AllowanceModule.Allowance memory)" + } + }, + "id": 522, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6883:72:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 523, + "nodeType": "ExpressionStatement", + "src": "6883:72:0" + } + } + ] + } + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 529, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 391, + "src": "6999:4:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + ], + "id": 528, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "6991:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 530, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6991:13:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 531, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 403, + "src": "7006:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 532, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 393, + "src": "7016:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 533, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 409, + "src": "7023:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_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_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + ], + "id": 527, + "name": "updateAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 358, + "src": "6975:15:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_address_$_t_struct$_Allowance_$81_memory_ptr_$returns$__$", + "typeString": "function (address,address,address,struct AllowanceModule.Allowance memory)" + } + }, + "id": 534, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6975:58:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 535, + "nodeType": "ExpressionStatement", + "src": "6975:58:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 537, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 403, + "src": "7172:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 538, + "name": "signature", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 405, + "src": "7182:9:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + { + "argumentTypes": null, + "id": 539, + "name": "transferHashData", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 419, + "src": "7193:16:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + { + "argumentTypes": null, + "id": 540, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 391, + "src": "7211: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": 536, + "name": "checkSignature", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 697, + "src": "7157:14:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_bytes_memory_ptr_$_t_bytes_memory_ptr_$_t_contract$_GnosisSafe_$18_$returns$__$", + "typeString": "function (address,bytes memory,bytes memory,contract GnosisSafe)" + } + }, + "id": 541, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7157:59:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 542, + "nodeType": "ExpressionStatement", + "src": "7157:59:0" + }, + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "id": 545, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 543, + "name": "payment", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 401, + "src": "7231:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 544, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7241:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "7231:11:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 555, + "nodeType": "IfStatement", + "src": "7227:184:0", + "trueBody": { + "id": 554, + "nodeType": "Block", + "src": "7244:167:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 547, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 391, + "src": "7361:4:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + }, + { + "argumentTypes": null, + "id": 548, + "name": "paymentToken", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 399, + "src": "7367:12:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 549, + "name": "tx", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4989, + "src": "7381:2:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_transaction", + "typeString": "tx" + } + }, + "id": 550, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "origin", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "7381:9:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 551, + "name": "payment", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 401, + "src": "7392: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": 546, + "name": "transfer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 873, + "src": "7352: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": 552, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7352:48:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 553, + "nodeType": "ExpressionStatement", + "src": "7352:48:0" + } + ] + } + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 557, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 391, + "src": "7455:4:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + }, + { + "argumentTypes": null, + "id": 558, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 393, + "src": "7461:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 559, + "name": "to", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 395, + "src": "7468:2:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 560, + "name": "amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 397, + "src": "7472: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": 556, + "name": "transfer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 873, + "src": "7446: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": 561, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7446:33:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 562, + "nodeType": "ExpressionStatement", + "src": "7446:33:0" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 565, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 391, + "src": "7527:4:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + ], + "id": 564, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "7519:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 566, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7519:13:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 567, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 403, + "src": "7534:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 568, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 393, + "src": "7544:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 569, + "name": "to", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 395, + "src": "7551:2:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 570, + "name": "amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 397, + "src": "7555:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + }, + "id": 574, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 571, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 409, + "src": "7563:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 572, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "nonce", + "nodeType": "MemberAccess", + "referencedDeclaration": 80, + "src": "7563:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 573, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7581:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "7563: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": 563, + "name": "ExecuteAllowanceTransfer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 107, + "src": "7494: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": 575, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7494:89:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 576, + "nodeType": "EmitStatement", + "src": "7489:94:0" + } + ] + }, + "documentation": null, + "id": 578, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "executeAllowanceTransfer", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 406, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 391, + "name": "safe", + "nodeType": "VariableDeclaration", + "scope": 578, + "src": "5387:15:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + }, + "typeName": { + "contractScope": null, + "id": 390, + "name": "GnosisSafe", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 18, + "src": "5387:10:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 393, + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 578, + "src": "5412:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 392, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5412:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 395, + "name": "to", + "nodeType": "VariableDeclaration", + "scope": 578, + "src": "5435:18:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + "typeName": { + "id": 394, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5435:15:0", + "stateMutability": "payable", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 397, + "name": "amount", + "nodeType": "VariableDeclaration", + "scope": 578, + "src": "5463:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "typeName": { + "id": 396, + "name": "uint96", + "nodeType": "ElementaryTypeName", + "src": "5463:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 399, + "name": "paymentToken", + "nodeType": "VariableDeclaration", + "scope": 578, + "src": "5486:20:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 398, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5486:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 401, + "name": "payment", + "nodeType": "VariableDeclaration", + "scope": 578, + "src": "5516:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "typeName": { + "id": 400, + "name": "uint96", + "nodeType": "ElementaryTypeName", + "src": "5516:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 403, + "name": "delegate", + "nodeType": "VariableDeclaration", + "scope": 578, + "src": "5540:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 402, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5540:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 405, + "name": "signature", + "nodeType": "VariableDeclaration", + "scope": 578, + "src": "5566:22:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 404, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "5566:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5377:217:0" + }, + "returnParameters": { + "id": 407, + "nodeType": "ParameterList", + "parameters": [], + "src": "5602:0:0" + }, + "scope": 1224, + "src": "5344:2246:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 625, + "nodeType": "Block", + "src": "7836:255:0", + "statements": [ + { + "assignments": [ + 598 + ], + "declarations": [ + { + "constant": false, + "id": 598, + "name": "transferHash", + "nodeType": "VariableDeclaration", + "scope": 625, + "src": "7846:20:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 597, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "7846:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 612, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 602, + "name": "ALLOWANCE_TRANSFER_TYPEHASH", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 36, + "src": "7903:27:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "argumentTypes": null, + "id": 603, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 580, + "src": "7932:4:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 604, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 582, + "src": "7938:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 605, + "name": "to", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 584, + "src": "7945:2:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 606, + "name": "amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 586, + "src": "7949:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + { + "argumentTypes": null, + "id": 607, + "name": "paymentToken", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 588, + "src": "7957:12:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 608, + "name": "payment", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 590, + "src": "7971:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + { + "argumentTypes": null, + "id": 609, + "name": "nonce", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 592, + "src": "7980: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": { + "argumentTypes": null, + "id": 600, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4964, + "src": "7892:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 601, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encode", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "7892:10:0", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencode_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 610, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7892:94:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 599, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4971, + "src": "7869:9:0", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 611, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7869:127:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "7846:150:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "hexValue": "30783139", + "id": 616, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8035:4:0", + "subdenomination": null, + "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": 615, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "8030:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes1_$", + "typeString": "type(bytes1)" + }, + "typeName": "byte" + }, + "id": 617, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8030:10:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "hexValue": "30783031", + "id": 619, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8047:4:0", + "subdenomination": null, + "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": 618, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "8042:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes1_$", + "typeString": "type(bytes1)" + }, + "typeName": "byte" + }, + "id": 620, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8042:10:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + { + "argumentTypes": null, + "id": 621, + "name": "domainSeparator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 63, + "src": "8054:15:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "argumentTypes": null, + "id": 622, + "name": "transferHash", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 598, + "src": "8071: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": { + "argumentTypes": null, + "id": 613, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4964, + "src": "8013:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 614, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "8013:16:0", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 623, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8013:71:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "functionReturnParameters": 596, + "id": 624, + "nodeType": "Return", + "src": "8006:78:0" + } + ] + }, + "documentation": null, + "id": 626, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "generateTransferHashData", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 593, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 580, + "name": "safe", + "nodeType": "VariableDeclaration", + "scope": 626, + "src": "7639:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 579, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "7639:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 582, + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 626, + "src": "7661:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 581, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "7661:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 584, + "name": "to", + "nodeType": "VariableDeclaration", + "scope": 626, + "src": "7684:10:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 583, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "7684:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 586, + "name": "amount", + "nodeType": "VariableDeclaration", + "scope": 626, + "src": "7704:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "typeName": { + "id": 585, + "name": "uint96", + "nodeType": "ElementaryTypeName", + "src": "7704:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 588, + "name": "paymentToken", + "nodeType": "VariableDeclaration", + "scope": 626, + "src": "7727:20:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 587, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "7727:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 590, + "name": "payment", + "nodeType": "VariableDeclaration", + "scope": 626, + "src": "7757:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "typeName": { + "id": 589, + "name": "uint96", + "nodeType": "ElementaryTypeName", + "src": "7757:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 592, + "name": "nonce", + "nodeType": "VariableDeclaration", + "scope": 626, + "src": "7781:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + }, + "typeName": { + "id": 591, + "name": "uint16", + "nodeType": "ElementaryTypeName", + "src": "7781:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "7629:170:0" + }, + "returnParameters": { + "id": 596, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 595, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 626, + "src": "7822:12:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 594, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "7822:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "7821:14:0" + }, + "scope": 1224, + "src": "7596:495:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "private" + }, + { + "body": { + "id": 657, + "nodeType": "Block", + "src": "8327:136:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 647, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 628, + "src": "8392:4:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 648, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 630, + "src": "8398:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 649, + "name": "to", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 632, + "src": "8405:2:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 650, + "name": "amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 634, + "src": "8409:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + { + "argumentTypes": null, + "id": 651, + "name": "paymentToken", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 636, + "src": "8417:12:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 652, + "name": "payment", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 638, + "src": "8431:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + { + "argumentTypes": null, + "id": 653, + "name": "nonce", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 640, + "src": "8440: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": 646, + "name": "generateTransferHashData", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 626, + "src": "8354: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": 654, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8354:101:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 645, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4971, + "src": "8344:9:0", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 655, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8344:112:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "functionReturnParameters": 644, + "id": 656, + "nodeType": "Return", + "src": "8337:119:0" + } + ] + }, + "documentation": null, + "id": 658, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "generateTransferHash", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 641, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 628, + "name": "safe", + "nodeType": "VariableDeclaration", + "scope": 658, + "src": "8136:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 627, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "8136:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 630, + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 658, + "src": "8158:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 629, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "8158:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 632, + "name": "to", + "nodeType": "VariableDeclaration", + "scope": 658, + "src": "8181:10:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 631, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "8181:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 634, + "name": "amount", + "nodeType": "VariableDeclaration", + "scope": 658, + "src": "8201:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "typeName": { + "id": 633, + "name": "uint96", + "nodeType": "ElementaryTypeName", + "src": "8201:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 636, + "name": "paymentToken", + "nodeType": "VariableDeclaration", + "scope": 658, + "src": "8224:20:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 635, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "8224:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 638, + "name": "payment", + "nodeType": "VariableDeclaration", + "scope": 658, + "src": "8254:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "typeName": { + "id": 637, + "name": "uint96", + "nodeType": "ElementaryTypeName", + "src": "8254:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 640, + "name": "nonce", + "nodeType": "VariableDeclaration", + "scope": 658, + "src": "8278:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + }, + "typeName": { + "id": 639, + "name": "uint16", + "nodeType": "ElementaryTypeName", + "src": "8278:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "8126:170:0" + }, + "returnParameters": { + "id": 644, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 643, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 658, + "src": "8318:7:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 642, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "8318:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "8317:9:0" + }, + "scope": 1224, + "src": "8097:366:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 696, + "nodeType": "Block", + "src": "8599:314:0", + "statements": [ + { + "assignments": [ + 670 + ], + "declarations": [ + { + "constant": false, + "id": 670, + "name": "signer", + "nodeType": "VariableDeclaration", + "scope": 696, + "src": "8609:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 669, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "8609:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 675, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 672, + "name": "signature", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 662, + "src": "8643:9:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + { + "argumentTypes": null, + "id": 673, + "name": "transferHashData", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 664, + "src": "8654: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": 671, + "name": "recoverSignature", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 818, + "src": "8626: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": 674, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8626:45:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "8609:62:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 692, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 679, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 677, + "name": "expectedDelegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 660, + "src": "8702:16:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "id": 678, + "name": "signer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 670, + "src": "8722:6:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "8702:26:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "&&", + "rightExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 691, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 680, + "name": "delegates", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 57, + "src": "8732:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_uint48_$_t_struct$_Delegate_$70_storage_$_$", + "typeString": "mapping(address => mapping(uint48 => struct AllowanceModule.Delegate storage ref))" + } + }, + "id": 684, + "indexExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 682, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 666, + "src": "8750:4:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + ], + "id": 681, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "8742:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 683, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8742:13:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "8732:24:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint48_$_t_struct$_Delegate_$70_storage_$", + "typeString": "mapping(uint48 => struct AllowanceModule.Delegate storage ref)" + } + }, + "id": 688, + "indexExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 686, + "name": "signer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 670, + "src": "8764:6:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 685, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "8757:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint48_$", + "typeString": "type(uint48)" + }, + "typeName": "uint48" + }, + "id": 687, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8757:14:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "8732:40:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$70_storage", + "typeString": "struct AllowanceModule.Delegate storage ref" + } + }, + "id": 689, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "delegate", + "nodeType": "MemberAccess", + "referencedDeclaration": 65, + "src": "8732:49:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "id": 690, + "name": "signer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 670, + "src": "8785:6:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "8732:59:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "8702:89:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "657870656374656444656c6567617465203d3d207369676e65722026262064656c6567617465735b616464726573732873616665295d5b75696e743438287369676e6572295d2e64656c6567617465203d3d207369676e6572", + "id": 693, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8805:91:0", + "subdenomination": null, + "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": 676, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 4980, + 4981 + ], + "referencedDeclaration": 4981, + "src": "8681:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 694, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8681:225:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 695, + "nodeType": "ExpressionStatement", + "src": "8681:225:0" + } + ] + }, + "documentation": null, + "id": 697, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "checkSignature", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 667, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 660, + "name": "expectedDelegate", + "nodeType": "VariableDeclaration", + "scope": 697, + "src": "8493:24:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 659, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "8493:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 662, + "name": "signature", + "nodeType": "VariableDeclaration", + "scope": 697, + "src": "8519:22:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 661, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "8519:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 664, + "name": "transferHashData", + "nodeType": "VariableDeclaration", + "scope": 697, + "src": "8543:29:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 663, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "8543:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 666, + "name": "safe", + "nodeType": "VariableDeclaration", + "scope": 697, + "src": "8574:15:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + }, + "typeName": { + "contractScope": null, + "id": 665, + "name": "GnosisSafe", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 18, + "src": "8574:10:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "8492:98:0" + }, + "returnParameters": { + "id": 668, + "nodeType": "ParameterList", + "parameters": [], + "src": "8599:0:0" + }, + "scope": 1224, + "src": "8469:444:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "private" + }, + { + "body": { + "id": 817, + "nodeType": "Block", + "src": "9037:1801:0", + "statements": [ + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 709, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 706, + "name": "signature", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 699, + "src": "9118:9:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 707, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "length", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "9118:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 708, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "9138:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "9118:21:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 713, + "nodeType": "IfStatement", + "src": "9114:44:0", + "trueBody": { + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 710, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4977, + "src": "9148:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 711, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "9148:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "functionReturnParameters": 705, + "id": 712, + "nodeType": "Return", + "src": "9141:17:0" + } + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 718, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 715, + "name": "signature", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 699, + "src": "9243:9:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 716, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "length", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "9243:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "argumentTypes": null, + "hexValue": "3635", + "id": 717, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "9263:2:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_65_by_1", + "typeString": "int_const 65" + }, + "value": "65" + }, + "src": "9243:22:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "7369676e6174757265732e6c656e677468203e3d203635", + "id": 719, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "9267:25:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_72679ed14e52badd3e78d9f29492b52cfb58b223fd9e00d5dca80ba1c385a7f7", + "typeString": "literal_string \"signatures.length >= 65\"" + }, + "value": "signatures.length >= 65" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_72679ed14e52badd3e78d9f29492b52cfb58b223fd9e00d5dca80ba1c385a7f7", + "typeString": "literal_string \"signatures.length >= 65\"" + } + ], + "id": 714, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 4980, + 4981 + ], + "referencedDeclaration": 4981, + "src": "9235:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 720, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9235:58:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 721, + "nodeType": "ExpressionStatement", + "src": "9235:58:0" + }, + { + "assignments": [ + 723 + ], + "declarations": [ + { + "constant": false, + "id": 723, + "name": "v", + "nodeType": "VariableDeclaration", + "scope": 817, + "src": "9303:7:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "typeName": { + "id": 722, + "name": "uint8", + "nodeType": "ElementaryTypeName", + "src": "9303:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 724, + "initialValue": null, + "nodeType": "VariableDeclarationStatement", + "src": "9303:7:0" + }, + { + "assignments": [ + 726 + ], + "declarations": [ + { + "constant": false, + "id": 726, + "name": "r", + "nodeType": "VariableDeclaration", + "scope": 817, + "src": "9320:9:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 725, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "9320:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 727, + "initialValue": null, + "nodeType": "VariableDeclarationStatement", + "src": "9320:9:0" + }, + { + "assignments": [ + 729 + ], + "declarations": [ + { + "constant": false, + "id": 729, + "name": "s", + "nodeType": "VariableDeclaration", + "scope": 817, + "src": "9339:9:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 728, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "9339:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 730, + "initialValue": null, + "nodeType": "VariableDeclarationStatement", + "src": "9339:9:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 739, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "components": [ + { + "argumentTypes": null, + "id": 731, + "name": "v", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 723, + "src": "9359:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + { + "argumentTypes": null, + "id": 732, + "name": "r", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 726, + "src": "9362:1:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "argumentTypes": null, + "id": 733, + "name": "s", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 729, + "src": "9365:1:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "id": 734, + "isConstant": false, + "isInlineArray": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "TupleExpression", + "src": "9358:9:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_uint8_$_t_bytes32_$_t_bytes32_$", + "typeString": "tuple(uint8,bytes32,bytes32)" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 736, + "name": "signature", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 699, + "src": "9385:9:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + { + "argumentTypes": null, + "hexValue": "30", + "id": 737, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "9396:1:0", + "subdenomination": null, + "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": 735, + "name": "signatureSplit", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3369, + "src": "9370: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": 738, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9370:28:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_uint8_$_t_bytes32_$_t_bytes32_$", + "typeString": "tuple(uint8,bytes32,bytes32)" + } + }, + "src": "9358:40:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 740, + "nodeType": "ExpressionStatement", + "src": "9358:40:0" + }, + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "id": 743, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 741, + "name": "v", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 723, + "src": "9465:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 742, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "9470:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "9465:6:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "id": 772, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 770, + "name": "v", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 723, + "src": "10193:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 771, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10198:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "10193:6:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "id": 781, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 779, + "name": "v", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 723, + "src": "10372:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "argumentTypes": null, + "hexValue": "3330", + "id": 780, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10376:2:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_30_by_1", + "typeString": "int_const 30" + }, + "value": "30" + }, + "src": "10372:6:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "id": 813, + "nodeType": "Block", + "src": "10683:149:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 811, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 802, + "name": "owner", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 704, + "src": "10766:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 805, + "name": "transferHashData", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 701, + "src": "10794:16:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 804, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4971, + "src": "10784:9:0", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 806, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10784:27:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "argumentTypes": null, + "id": 807, + "name": "v", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 723, + "src": "10813:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + { + "argumentTypes": null, + "id": 808, + "name": "r", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 726, + "src": "10816:1:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "argumentTypes": null, + "id": 809, + "name": "s", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 729, + "src": "10819: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": 803, + "name": "ecrecover", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4969, + "src": "10774: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": 810, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10774:47:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "10766:55:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 812, + "nodeType": "ExpressionStatement", + "src": "10766:55:0" + } + ] + }, + "id": 814, + "nodeType": "IfStatement", + "src": "10368:464:0", + "trueBody": { + "id": 801, + "nodeType": "Block", + "src": "10380:297:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 799, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 782, + "name": "owner", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 704, + "src": "10542:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "hexValue": "19457468657265756d205369676e6564204d6573736167653a0a3332", + "id": 787, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10587:34:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_178a2411ab6fbc1ba11064408972259c558d0e82fd48b0aba3ad81d14f065e73", + "typeString": "literal_string \"\u0019Ethereum Signed Message:\n32\"" + }, + "value": "\u0019Ethereum Signed Message:\n32" + }, + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 789, + "name": "transferHashData", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 701, + "src": "10633:16:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 788, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4971, + "src": "10623:9:0", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 790, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10623:27:0", + "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": { + "argumentTypes": null, + "id": 785, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4964, + "src": "10570:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 786, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "10570:16:0", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 791, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10570:81:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 784, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4971, + "src": "10560:9:0", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 792, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10560:92:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "id": 795, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 793, + "name": "v", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 723, + "src": "10654:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "argumentTypes": null, + "hexValue": "34", + "id": 794, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10658:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_4_by_1", + "typeString": "int_const 4" + }, + "value": "4" + }, + "src": "10654:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + { + "argumentTypes": null, + "id": 796, + "name": "r", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 726, + "src": "10661:1:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "argumentTypes": null, + "id": 797, + "name": "s", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 729, + "src": "10664: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": 783, + "name": "ecrecover", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4969, + "src": "10550: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": 798, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10550:116:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "10542:124:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 800, + "nodeType": "ExpressionStatement", + "src": "10542:124:0" + } + ] + } + }, + "id": 815, + "nodeType": "IfStatement", + "src": "10189:643:0", + "trueBody": { + "id": 778, + "nodeType": "Block", + "src": "10201:161:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 776, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 773, + "name": "owner", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 704, + "src": "10333:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 774, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4977, + "src": "10341:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 775, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "10341:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "src": "10333:18:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 777, + "nodeType": "ExpressionStatement", + "src": "10333:18:0" + } + ] + } + }, + "id": 816, + "nodeType": "IfStatement", + "src": "9461:1371:0", + "trueBody": { + "id": 769, + "nodeType": "Block", + "src": "9473:710:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 750, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 744, + "name": "owner", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 704, + "src": "9582:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 747, + "name": "r", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 726, + "src": "9606:1:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 746, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "9598:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + }, + "typeName": "uint256" + }, + "id": 748, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9598:10:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 745, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "9590:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 749, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9590:19:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "src": "9582:27:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 751, + "nodeType": "ExpressionStatement", + "src": "9582:27:0" + }, + { + "assignments": [ + 753 + ], + "declarations": [ + { + "constant": false, + "id": 753, + "name": "contractSignature", + "nodeType": "VariableDeclaration", + "scope": 769, + "src": "9623:30:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 752, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "9623:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 754, + "initialValue": null, + "nodeType": "VariableDeclarationStatement", + "src": "9623:30:0" + }, + { + "externalReferences": [ + { + "contractSignature": { + "declaration": 753, + "isOffset": false, + "isSlot": false, + "src": "9897:17:0", + "valueSize": 1 + } + }, + { + "signature": { + "declaration": 699, + "isOffset": false, + "isSlot": false, + "src": "9926:9:0", + "valueSize": 1 + } + }, + { + "s": { + "declaration": 729, + "isOffset": false, + "isSlot": false, + "src": "9937:1:0", + "valueSize": 1 + } + } + ], + "id": 755, + "nodeType": "InlineAssembly", + "operations": "{\n contractSignature := add(add(signature, s), 0x20)\n}", + "src": "9735:225:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_bytes4", + "typeString": "bytes4" + }, + "id": 765, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 761, + "name": "transferHashData", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 701, + "src": "10042:16:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + { + "argumentTypes": null, + "id": 762, + "name": "contractSignature", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 753, + "src": "10060:17: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" + } + ], + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 758, + "name": "owner", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 704, + "src": "10018:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 757, + "name": "ISignatureValidator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3516, + "src": "9998:19:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_ISignatureValidator_$3516_$", + "typeString": "type(contract ISignatureValidator)" + } + }, + "id": 759, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9998:26:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_ISignatureValidator_$3516", + "typeString": "contract ISignatureValidator" + } + }, + "id": 760, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "isValidSignature", + "nodeType": "MemberAccess", + "referencedDeclaration": 3515, + "src": "9998:43:0", + "typeDescriptions": { + "typeIdentifier": "t_function_external_view$_t_bytes_memory_ptr_$_t_bytes_memory_ptr_$returns$_t_bytes4_$", + "typeString": "function (bytes memory,bytes memory) view external returns (bytes4)" + } + }, + "id": 763, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9998:80:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes4", + "typeString": "bytes4" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "id": 764, + "name": "EIP1271_MAGIC_VALUE", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3503, + "src": "10082:19:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes4", + "typeString": "bytes4" + } + }, + "src": "9998:103:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "436f756c64206e6f742076616c6964617465204549502d31323731207369676e6174757265", + "id": 766, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10119:39:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_28b765f195c3cd598e06ecb11ef8b4894757ebf4babad4a035bcaf2f5d0e18e5", + "typeString": "literal_string \"Could not validate EIP-1271 signature\"" + }, + "value": "Could not validate EIP-1271 signature" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_28b765f195c3cd598e06ecb11ef8b4894757ebf4babad4a035bcaf2f5d0e18e5", + "typeString": "literal_string \"Could not validate EIP-1271 signature\"" + } + ], + "id": 756, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 4980, + 4981 + ], + "referencedDeclaration": 4981, + "src": "9973:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 767, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9973:199:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 768, + "nodeType": "ExpressionStatement", + "src": "9973:199:0" + } + ] + } + } + ] + }, + "documentation": null, + "id": 818, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "recoverSignature", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 702, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 699, + "name": "signature", + "nodeType": "VariableDeclaration", + "scope": 818, + "src": "8945:22:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 698, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "8945:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 701, + "name": "transferHashData", + "nodeType": "VariableDeclaration", + "scope": 818, + "src": "8969:29:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 700, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "8969:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "8944:55:0" + }, + "returnParameters": { + "id": 705, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 704, + "name": "owner", + "nodeType": "VariableDeclaration", + "scope": 818, + "src": "9022:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 703, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "9022:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "9021:15:0" + }, + "scope": 1224, + "src": "8919:1919:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "private" + }, + { + "body": { + "id": 872, + "nodeType": "Block", + "src": "10937:476:0", + "statements": [ + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 833, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 829, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 822, + "src": "10951:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "hexValue": "30", + "id": 831, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10968:1:0", + "subdenomination": null, + "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": 830, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "10960:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 832, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10960:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "src": "10951:19:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "id": 870, + "nodeType": "Block", + "src": "11172:235:0", + "statements": [ + { + "assignments": [ + 849 + ], + "declarations": [ + { + "constant": false, + "id": 849, + "name": "data", + "nodeType": "VariableDeclaration", + "scope": 870, + "src": "11186:17:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 848, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "11186:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 856, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "hexValue": "7472616e7366657228616464726573732c75696e7432353629", + "id": 852, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "11230:27:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_a9059cbb2ab09eb219583f4a59a5d0623ade346d962bcd4e46b11da047c9049b", + "typeString": "literal_string \"transfer(address,uint256)\"" + }, + "value": "transfer(address,uint256)" + }, + { + "argumentTypes": null, + "id": 853, + "name": "to", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 824, + "src": "11259:2:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 854, + "name": "amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 826, + "src": "11263: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": { + "argumentTypes": null, + "id": 850, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4964, + "src": "11206:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 851, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encodeWithSignature", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "11206: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": 855, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11206:64:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "11186:84:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 860, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 822, + "src": "11323:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "hexValue": "30", + "id": 861, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "11330:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + { + "argumentTypes": null, + "id": 862, + "name": "data", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 849, + "src": "11333:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 863, + "name": "Enum", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3235, + "src": "11339:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_Enum_$3235_$", + "typeString": "type(contract Enum)" + } + }, + "id": 864, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "Operation", + "nodeType": "MemberAccess", + "referencedDeclaration": 3234, + "src": "11339:14:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Operation_$3234_$", + "typeString": "type(enum Enum.Operation)" + } + }, + "id": 865, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "Call", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "11339:19:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Operation_$3234", + "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_$3234", + "typeString": "enum Enum.Operation" + } + ], + "expression": { + "argumentTypes": null, + "id": 858, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 820, + "src": "11292:4:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + }, + "id": 859, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "execTransactionFromModule", + "nodeType": "MemberAccess", + "referencedDeclaration": 17, + "src": "11292:30:0", + "typeDescriptions": { + "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$_t_bytes_memory_ptr_$_t_enum$_Operation_$3234_$returns$_t_bool_$", + "typeString": "function (address,uint256,bytes memory,enum Enum.Operation) external returns (bool)" + } + }, + "id": 866, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11292:67:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "436f756c64206e6f74206578656375746520746f6b656e207472616e73666572", + "id": 867, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "11361:34:0", + "subdenomination": null, + "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": 857, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 4980, + 4981 + ], + "referencedDeclaration": 4981, + "src": "11284:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 868, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11284:112:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 869, + "nodeType": "ExpressionStatement", + "src": "11284:112:0" + } + ] + }, + "id": 871, + "nodeType": "IfStatement", + "src": "10947:460:0", + "trueBody": { + "id": 847, + "nodeType": "Block", + "src": "10972:194:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 837, + "name": "to", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 824, + "src": "11082:2:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 838, + "name": "amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 826, + "src": "11086:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + { + "argumentTypes": null, + "hexValue": "", + "id": 839, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "11094:2:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470", + "typeString": "literal_string \"\"" + }, + "value": "" + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 840, + "name": "Enum", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3235, + "src": "11098:4:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_Enum_$3235_$", + "typeString": "type(contract Enum)" + } + }, + "id": 841, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "Operation", + "nodeType": "MemberAccess", + "referencedDeclaration": 3234, + "src": "11098:14:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_Operation_$3234_$", + "typeString": "type(enum Enum.Operation)" + } + }, + "id": 842, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "Call", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "11098:19:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_Operation_$3234", + "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_$3234", + "typeString": "enum Enum.Operation" + } + ], + "expression": { + "argumentTypes": null, + "id": 835, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 820, + "src": "11051:4:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + }, + "id": 836, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "execTransactionFromModule", + "nodeType": "MemberAccess", + "referencedDeclaration": 17, + "src": "11051:30:0", + "typeDescriptions": { + "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$_t_bytes_memory_ptr_$_t_enum$_Operation_$3234_$returns$_t_bool_$", + "typeString": "function (address,uint256,bytes memory,enum Enum.Operation) external returns (bool)" + } + }, + "id": 843, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11051:67:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "436f756c64206e6f742065786563757465206574686572207472616e73666572", + "id": 844, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "11120:34:0", + "subdenomination": null, + "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": 834, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 4980, + 4981 + ], + "referencedDeclaration": 4981, + "src": "11043:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 845, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11043:112:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 846, + "nodeType": "ExpressionStatement", + "src": "11043:112:0" + } + ] + } + } + ] + }, + "documentation": null, + "id": 873, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "transfer", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 827, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 820, + "name": "safe", + "nodeType": "VariableDeclaration", + "scope": 873, + "src": "10862:15:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + }, + "typeName": { + "contractScope": null, + "id": 819, + "name": "GnosisSafe", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 18, + "src": "10862:10:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_GnosisSafe_$18", + "typeString": "contract GnosisSafe" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 822, + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 873, + "src": "10879:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 821, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "10879:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 824, + "name": "to", + "nodeType": "VariableDeclaration", + "scope": 873, + "src": "10894:18:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + "typeName": { + "id": 823, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "10894:15:0", + "stateMutability": "payable", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 826, + "name": "amount", + "nodeType": "VariableDeclaration", + "scope": 873, + "src": "10914:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + }, + "typeName": { + "id": 825, + "name": "uint96", + "nodeType": "ElementaryTypeName", + "src": "10914:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "10861:67:0" + }, + "returnParameters": { + "id": 828, + "nodeType": "ParameterList", + "parameters": [], + "src": "10937:0:0" + }, + "scope": 1224, + "src": "10844:569:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "private" + }, + { + "body": { + "id": 889, + "nodeType": "Block", + "src": "11509:46:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 883, + "name": "tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 51, + "src": "11526: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": 885, + "indexExpression": { + "argumentTypes": null, + "id": 884, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 875, + "src": "11533:4:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "11526:12:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_array$_t_address_$dyn_storage_$", + "typeString": "mapping(address => address[] storage ref)" + } + }, + "id": 887, + "indexExpression": { + "argumentTypes": null, + "id": 886, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 877, + "src": "11539:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "11526:22:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "functionReturnParameters": 882, + "id": 888, + "nodeType": "Return", + "src": "11519:29:0" + } + ] + }, + "documentation": null, + "id": 890, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getTokens", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 878, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 875, + "name": "safe", + "nodeType": "VariableDeclaration", + "scope": 890, + "src": "11438:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 874, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "11438:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 877, + "name": "delegate", + "nodeType": "VariableDeclaration", + "scope": 890, + "src": "11452:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 876, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "11452:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "11437:32:0" + }, + "returnParameters": { + "id": 882, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 881, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 890, + "src": "11491:16:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[]" + }, + "typeName": { + "baseType": { + "id": 879, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "11491:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 880, + "length": null, + "nodeType": "ArrayTypeName", + "src": "11491:9:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "11490:18:0" + }, + "scope": 1224, + "src": "11419:136:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 933, + "nodeType": "Block", + "src": "11675:313:0", + "statements": [ + { + "assignments": [ + 904 + ], + "declarations": [ + { + "constant": false, + "id": 904, + "name": "allowance", + "nodeType": "VariableDeclaration", + "scope": 933, + "src": "11685:26:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance" + }, + "typeName": { + "contractScope": null, + "id": 903, + "name": "Allowance", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 81, + "src": "11685:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_storage_ptr", + "typeString": "struct AllowanceModule.Allowance" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 910, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 906, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 892, + "src": "11727:4:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 907, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 894, + "src": "11733:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 908, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 896, + "src": "11743: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": 905, + "name": "getAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 336, + "src": "11714:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_address_$_t_address_$_t_address_$returns$_t_struct$_Allowance_$81_memory_ptr_$", + "typeString": "function (address,address,address) view returns (struct AllowanceModule.Allowance memory)" + } + }, + "id": 909, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11714:35:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "11685:64:0" + }, + { + "expression": { + "argumentTypes": null, + "components": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 912, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 904, + "src": "11788:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 913, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "amount", + "nodeType": "MemberAccess", + "referencedDeclaration": 72, + "src": "11788:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + ], + "id": 911, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "11780:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + }, + "typeName": "uint256" + }, + "id": 914, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11780:25:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 916, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 904, + "src": "11827:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 917, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "spent", + "nodeType": "MemberAccess", + "referencedDeclaration": 74, + "src": "11827:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + ], + "id": 915, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "11819:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + }, + "typeName": "uint256" + }, + "id": 918, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11819:24:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 920, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 904, + "src": "11865:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 921, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "resetTimeMin", + "nodeType": "MemberAccess", + "referencedDeclaration": 76, + "src": "11865:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + ], + "id": 919, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "11857:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + }, + "typeName": "uint256" + }, + "id": 922, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11857:31:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 924, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 904, + "src": "11910:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 925, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "lastResetMin", + "nodeType": "MemberAccess", + "referencedDeclaration": 78, + "src": "11910:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + ], + "id": 923, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "11902:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + }, + "typeName": "uint256" + }, + "id": 926, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11902:31:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 928, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 904, + "src": "11955:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 929, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "nonce", + "nodeType": "MemberAccess", + "referencedDeclaration": 80, + "src": "11955:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + ], + "id": 927, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "11947:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + }, + "typeName": "uint256" + }, + "id": 930, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11947:24:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 931, + "isConstant": false, + "isInlineArray": true, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "11766:215:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$5_memory_ptr", + "typeString": "uint256[5] memory" + } + }, + "functionReturnParameters": 902, + "id": 932, + "nodeType": "Return", + "src": "11759:222:0" + } + ] + }, + "documentation": null, + "id": 934, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getTokenAllowance", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 897, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 892, + "name": "safe", + "nodeType": "VariableDeclaration", + "scope": 934, + "src": "11588:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 891, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "11588:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 894, + "name": "delegate", + "nodeType": "VariableDeclaration", + "scope": 934, + "src": "11602:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 893, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "11602:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 896, + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 934, + "src": "11620:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 895, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "11620:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "11587:47:0" + }, + "returnParameters": { + "id": 902, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 901, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 934, + "src": "11656:17:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$5_memory_ptr", + "typeString": "uint256[5]" + }, + "typeName": { + "baseType": { + "id": 898, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "11656:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 900, + "length": { + "argumentTypes": null, + "hexValue": "35", + "id": 899, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "11664:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_5_by_1", + "typeString": "int_const 5" + }, + "value": "5" + }, + "nodeType": "ArrayTypeName", + "src": "11656:10:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$5_storage_ptr", + "typeString": "uint256[5]" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "11655:19:0" + }, + "scope": 1224, + "src": "11561:427:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 1010, + "nodeType": "Block", + "src": "12040:517:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 944, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 940, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 936, + "src": "12058:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "hexValue": "30", + "id": 942, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12078:1:0", + "subdenomination": null, + "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": 941, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "12070:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 943, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12070:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "src": "12058:22:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "496e76616c69642064656c65676174652061646472657373", + "id": 945, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12082:26:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_2748b75fa8e9228d9f46d849def917a80513930a212cbb86b833e29bb53a5909", + "typeString": "literal_string \"Invalid delegate address\"" + }, + "value": "Invalid delegate address" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_2748b75fa8e9228d9f46d849def917a80513930a212cbb86b833e29bb53a5909", + "typeString": "literal_string \"Invalid delegate address\"" + } + ], + "id": 939, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 4980, + 4981 + ], + "referencedDeclaration": 4981, + "src": "12050:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 946, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12050:59:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 947, + "nodeType": "ExpressionStatement", + "src": "12050:59:0" + }, + { + "assignments": [ + 949 + ], + "declarations": [ + { + "constant": false, + "id": 949, + "name": "index", + "nodeType": "VariableDeclaration", + "scope": 1010, + "src": "12119:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + }, + "typeName": { + "id": 948, + "name": "uint48", + "nodeType": "ElementaryTypeName", + "src": "12119:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 953, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 951, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 936, + "src": "12141:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 950, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "12134:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint48_$", + "typeString": "type(uint48)" + }, + "typeName": "uint48" + }, + "id": 952, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12134:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "12119:31:0" + }, + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 964, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 954, + "name": "delegates", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 57, + "src": "12213:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_uint48_$_t_struct$_Delegate_$70_storage_$_$", + "typeString": "mapping(address => mapping(uint48 => struct AllowanceModule.Delegate storage ref))" + } + }, + "id": 957, + "indexExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 955, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4977, + "src": "12223:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 956, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "12223:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "12213:21:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint48_$_t_struct$_Delegate_$70_storage_$", + "typeString": "mapping(uint48 => struct AllowanceModule.Delegate storage ref)" + } + }, + "id": 959, + "indexExpression": { + "argumentTypes": null, + "id": 958, + "name": "index", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 949, + "src": "12235:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "12213:28:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$70_storage", + "typeString": "struct AllowanceModule.Delegate storage ref" + } + }, + "id": 960, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "delegate", + "nodeType": "MemberAccess", + "referencedDeclaration": 65, + "src": "12213:37:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "hexValue": "30", + "id": 962, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12262:1:0", + "subdenomination": null, + "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": 961, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "12254:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 963, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12254:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "src": "12213:51:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 966, + "nodeType": "IfStatement", + "src": "12210:63:0", + "trueBody": { + "expression": null, + "functionReturnParameters": 938, + "id": 965, + "nodeType": "Return", + "src": "12266:7:0" + } + }, + { + "assignments": [ + 968 + ], + "declarations": [ + { + "constant": false, + "id": 968, + "name": "startIndex", + "nodeType": "VariableDeclaration", + "scope": 1010, + "src": "12282:17:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + }, + "typeName": { + "id": 967, + "name": "uint48", + "nodeType": "ElementaryTypeName", + "src": "12282:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 973, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 969, + "name": "delegatesStart", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 61, + "src": "12302:14:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint48_$", + "typeString": "mapping(address => uint48)" + } + }, + "id": 972, + "indexExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 970, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4977, + "src": "12317:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 971, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "12317:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "12302:26:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "12282:46:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 985, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 974, + "name": "delegates", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 57, + "src": "12338:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_uint48_$_t_struct$_Delegate_$70_storage_$_$", + "typeString": "mapping(address => mapping(uint48 => struct AllowanceModule.Delegate storage ref))" + } + }, + "id": 978, + "indexExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 975, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4977, + "src": "12348:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 976, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "12348:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "12338:21:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint48_$_t_struct$_Delegate_$70_storage_$", + "typeString": "mapping(uint48 => struct AllowanceModule.Delegate storage ref)" + } + }, + "id": 979, + "indexExpression": { + "argumentTypes": null, + "id": 977, + "name": "index", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 949, + "src": "12360:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "12338:28:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$70_storage", + "typeString": "struct AllowanceModule.Delegate storage ref" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 981, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 936, + "src": "12378:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "hexValue": "30", + "id": 982, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12388:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + { + "argumentTypes": null, + "id": 983, + "name": "startIndex", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 968, + "src": "12391: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": 980, + "name": "Delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 70, + "src": "12369:8:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_struct$_Delegate_$70_storage_ptr_$", + "typeString": "type(struct AllowanceModule.Delegate storage pointer)" + } + }, + "id": 984, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "structConstructorCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12369:33:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$70_memory", + "typeString": "struct AllowanceModule.Delegate memory" + } + }, + "src": "12338:64:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$70_storage", + "typeString": "struct AllowanceModule.Delegate storage ref" + } + }, + "id": 986, + "nodeType": "ExpressionStatement", + "src": "12338:64:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 995, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 987, + "name": "delegates", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 57, + "src": "12412:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_uint48_$_t_struct$_Delegate_$70_storage_$_$", + "typeString": "mapping(address => mapping(uint48 => struct AllowanceModule.Delegate storage ref))" + } + }, + "id": 991, + "indexExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 988, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4977, + "src": "12422:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 989, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "12422:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "12412:21:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint48_$_t_struct$_Delegate_$70_storage_$", + "typeString": "mapping(uint48 => struct AllowanceModule.Delegate storage ref)" + } + }, + "id": 992, + "indexExpression": { + "argumentTypes": null, + "id": 990, + "name": "startIndex", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 968, + "src": "12434:10:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "12412:33:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$70_storage", + "typeString": "struct AllowanceModule.Delegate storage ref" + } + }, + "id": 993, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "prev", + "nodeType": "MemberAccess", + "referencedDeclaration": 67, + "src": "12412:38:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 994, + "name": "index", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 949, + "src": "12453:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "src": "12412:46:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "id": 996, + "nodeType": "ExpressionStatement", + "src": "12412:46:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 1002, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 997, + "name": "delegatesStart", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 61, + "src": "12468:14:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint48_$", + "typeString": "mapping(address => uint48)" + } + }, + "id": 1000, + "indexExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 998, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4977, + "src": "12483:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 999, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "12483:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "12468:26:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 1001, + "name": "index", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 949, + "src": "12497:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "src": "12468:34:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "id": 1003, + "nodeType": "ExpressionStatement", + "src": "12468:34:0" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1005, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4977, + "src": "12529:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1006, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "12529:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 1007, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 936, + "src": "12541:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 1004, + "name": "AddDelegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 87, + "src": "12517:11:0", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$returns$__$", + "typeString": "function (address,address)" + } + }, + "id": 1008, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12517:33:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1009, + "nodeType": "EmitStatement", + "src": "12512:38:0" + } + ] + }, + "documentation": null, + "id": 1011, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "addDelegate", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 937, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 936, + "name": "delegate", + "nodeType": "VariableDeclaration", + "scope": 1011, + "src": "12015:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 935, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "12015:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "12014:18:0" + }, + "returnParameters": { + "id": 938, + "nodeType": "ParameterList", + "parameters": [], + "src": "12040:0:0" + }, + "scope": 1224, + "src": "11994:563:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 1136, + "nodeType": "Block", + "src": "12612:918:0", + "statements": [ + { + "assignments": [ + 1017 + ], + "declarations": [ + { + "constant": false, + "id": 1017, + "name": "current", + "nodeType": "VariableDeclaration", + "scope": 1136, + "src": "12622:23:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$70_memory_ptr", + "typeString": "struct AllowanceModule.Delegate" + }, + "typeName": { + "contractScope": null, + "id": 1016, + "name": "Delegate", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 70, + "src": "12622:8:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$70_storage_ptr", + "typeString": "struct AllowanceModule.Delegate" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 1026, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1018, + "name": "delegates", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 57, + "src": "12648:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_uint48_$_t_struct$_Delegate_$70_storage_$_$", + "typeString": "mapping(address => mapping(uint48 => struct AllowanceModule.Delegate storage ref))" + } + }, + "id": 1021, + "indexExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1019, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4977, + "src": "12658:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1020, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "12658:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "12648:21:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint48_$_t_struct$_Delegate_$70_storage_$", + "typeString": "mapping(uint48 => struct AllowanceModule.Delegate storage ref)" + } + }, + "id": 1025, + "indexExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1023, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1013, + "src": "12677:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 1022, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "12670:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint48_$", + "typeString": "type(uint48)" + }, + "typeName": "uint48" + }, + "id": 1024, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12670:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "12648:39:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$70_storage", + "typeString": "struct AllowanceModule.Delegate storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "12622:65:0" + }, + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 1032, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1027, + "name": "current", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1017, + "src": "12750:7:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$70_memory_ptr", + "typeString": "struct AllowanceModule.Delegate memory" + } + }, + "id": 1028, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "delegate", + "nodeType": "MemberAccess", + "referencedDeclaration": 65, + "src": "12750:16:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "hexValue": "30", + "id": 1030, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12778:1:0", + "subdenomination": null, + "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": 1029, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "12770:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 1031, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12770:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "src": "12750:30:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 1034, + "nodeType": "IfStatement", + "src": "12747:42:0", + "trueBody": { + "expression": null, + "functionReturnParameters": 1015, + "id": 1033, + "nodeType": "Return", + "src": "12782:7:0" + } + }, + { + "assignments": [ + 1038 + ], + "declarations": [ + { + "constant": false, + "id": 1038, + "name": "delegateTokens", + "nodeType": "VariableDeclaration", + "scope": 1136, + "src": "12798:32:0", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + }, + "typeName": { + "baseType": { + "id": 1036, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "12798:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 1037, + "length": null, + "nodeType": "ArrayTypeName", + "src": "12798:9:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 1045, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1039, + "name": "tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 51, + "src": "12833: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": 1042, + "indexExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1040, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4977, + "src": "12840:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1041, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "12840:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "12833:18:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_array$_t_address_$dyn_storage_$", + "typeString": "mapping(address => address[] storage ref)" + } + }, + "id": 1044, + "indexExpression": { + "argumentTypes": null, + "id": 1043, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1013, + "src": "12852:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "12833:28:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "12798:63:0" + }, + { + "body": { + "id": 1104, + "nodeType": "Block", + "src": "12923:420:0", + "statements": [ + { + "assignments": [ + 1058 + ], + "declarations": [ + { + "constant": false, + "id": 1058, + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 1104, + "src": "12937:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1057, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "12937:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 1062, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1059, + "name": "delegateTokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1038, + "src": "12953:14:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[] storage pointer" + } + }, + "id": 1061, + "indexExpression": { + "argumentTypes": null, + "id": 1060, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1047, + "src": "12968:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "12953:17:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "12937:33:0" + }, + { + "assignments": [ + 1064 + ], + "declarations": [ + { + "constant": false, + "id": 1064, + "name": "allowance", + "nodeType": "VariableDeclaration", + "scope": 1104, + "src": "13046:26:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance" + }, + "typeName": { + "contractScope": null, + "id": 1063, + "name": "Allowance", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 81, + "src": "13046:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_storage_ptr", + "typeString": "struct AllowanceModule.Allowance" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 1071, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1066, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4977, + "src": "13088:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1067, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "13088:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 1068, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1013, + "src": "13100:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 1069, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1058, + "src": "13110: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": 1065, + "name": "getAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 336, + "src": "13075:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_address_$_t_address_$_t_address_$returns$_t_struct$_Allowance_$81_memory_ptr_$", + "typeString": "function (address,address,address) view returns (struct AllowanceModule.Allowance memory)" + } + }, + "id": 1070, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13075:41:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "13046:70:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 1076, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1072, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1064, + "src": "13130:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 1074, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "amount", + "nodeType": "MemberAccess", + "referencedDeclaration": 72, + "src": "13130:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "30", + "id": 1075, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13149:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "13130:20:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "id": 1077, + "nodeType": "ExpressionStatement", + "src": "13130:20:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 1082, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1078, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1064, + "src": "13164:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 1080, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "spent", + "nodeType": "MemberAccess", + "referencedDeclaration": 74, + "src": "13164:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "30", + "id": 1081, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13182:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "13164:19:0", + "typeDescriptions": { + "typeIdentifier": "t_uint96", + "typeString": "uint96" + } + }, + "id": 1083, + "nodeType": "ExpressionStatement", + "src": "13164:19:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 1088, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1084, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1064, + "src": "13197:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 1086, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "resetTimeMin", + "nodeType": "MemberAccess", + "referencedDeclaration": 76, + "src": "13197:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "30", + "id": 1087, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13222:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "13197:26:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "id": 1089, + "nodeType": "ExpressionStatement", + "src": "13197:26:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 1094, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1090, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1064, + "src": "13237:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + }, + "id": 1092, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "lastResetMin", + "nodeType": "MemberAccess", + "referencedDeclaration": 78, + "src": "13237:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "30", + "id": 1093, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13262:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "13237:26:0", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "id": 1095, + "nodeType": "ExpressionStatement", + "src": "13237:26:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1097, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4977, + "src": "13293:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1098, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "13293:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 1099, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1013, + "src": "13305:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 1100, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1058, + "src": "13315:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 1101, + "name": "allowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1064, + "src": "13322:9:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Allowance_$81_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_$81_memory_ptr", + "typeString": "struct AllowanceModule.Allowance memory" + } + ], + "id": 1096, + "name": "updateAllowance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 358, + "src": "13277:15:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_address_$_t_struct$_Allowance_$81_memory_ptr_$returns$__$", + "typeString": "function (address,address,address,struct AllowanceModule.Allowance memory)" + } + }, + "id": 1102, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13277:55:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1103, + "nodeType": "ExpressionStatement", + "src": "13277:55:0" + } + ] + }, + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 1053, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 1050, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1047, + "src": "12891:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1051, + "name": "delegateTokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1038, + "src": "12895:14:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[] storage pointer" + } + }, + "id": 1052, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "length", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "12895:21:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "12891:25:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 1105, + "initializationExpression": { + "assignments": [ + 1047 + ], + "declarations": [ + { + "constant": false, + "id": 1047, + "name": "i", + "nodeType": "VariableDeclaration", + "scope": 1105, + "src": "12876:9:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1046, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "12876:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 1049, + "initialValue": { + "argumentTypes": null, + "hexValue": "30", + "id": 1048, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12888:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "nodeType": "VariableDeclarationStatement", + "src": "12876:13:0" + }, + "loopExpression": { + "expression": { + "argumentTypes": null, + "id": 1055, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "12918:3:0", + "subExpression": { + "argumentTypes": null, + "id": 1054, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1047, + "src": "12918:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 1056, + "nodeType": "ExpressionStatement", + "src": "12918:3:0" + }, + "nodeType": "ForStatement", + "src": "12871:472:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 1116, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1106, + "name": "delegates", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 57, + "src": "13352:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_uint48_$_t_struct$_Delegate_$70_storage_$_$", + "typeString": "mapping(address => mapping(uint48 => struct AllowanceModule.Delegate storage ref))" + } + }, + "id": 1111, + "indexExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1107, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4977, + "src": "13362:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1108, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "13362:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "13352:21:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint48_$_t_struct$_Delegate_$70_storage_$", + "typeString": "mapping(uint48 => struct AllowanceModule.Delegate storage ref)" + } + }, + "id": 1112, + "indexExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1109, + "name": "current", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1017, + "src": "13374:7:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$70_memory_ptr", + "typeString": "struct AllowanceModule.Delegate memory" + } + }, + "id": 1110, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "prev", + "nodeType": "MemberAccess", + "referencedDeclaration": 67, + "src": "13374:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "13352:35:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$70_storage", + "typeString": "struct AllowanceModule.Delegate storage ref" + } + }, + "id": 1113, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "next", + "nodeType": "MemberAccess", + "referencedDeclaration": 69, + "src": "13352:40:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1114, + "name": "current", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1017, + "src": "13395:7:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$70_memory_ptr", + "typeString": "struct AllowanceModule.Delegate memory" + } + }, + "id": 1115, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "next", + "nodeType": "MemberAccess", + "referencedDeclaration": 69, + "src": "13395:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "src": "13352:55:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "id": 1117, + "nodeType": "ExpressionStatement", + "src": "13352:55:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 1128, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1118, + "name": "delegates", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 57, + "src": "13417:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_uint48_$_t_struct$_Delegate_$70_storage_$_$", + "typeString": "mapping(address => mapping(uint48 => struct AllowanceModule.Delegate storage ref))" + } + }, + "id": 1123, + "indexExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1119, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4977, + "src": "13427:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1120, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "13427:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "13417:21:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint48_$_t_struct$_Delegate_$70_storage_$", + "typeString": "mapping(uint48 => struct AllowanceModule.Delegate storage ref)" + } + }, + "id": 1124, + "indexExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1121, + "name": "current", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1017, + "src": "13439:7:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$70_memory_ptr", + "typeString": "struct AllowanceModule.Delegate memory" + } + }, + "id": 1122, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "next", + "nodeType": "MemberAccess", + "referencedDeclaration": 69, + "src": "13439:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "13417:35:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$70_storage", + "typeString": "struct AllowanceModule.Delegate storage ref" + } + }, + "id": 1125, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "prev", + "nodeType": "MemberAccess", + "referencedDeclaration": 67, + "src": "13417:40:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1126, + "name": "current", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1017, + "src": "13460:7:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$70_memory_ptr", + "typeString": "struct AllowanceModule.Delegate memory" + } + }, + "id": 1127, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "prev", + "nodeType": "MemberAccess", + "referencedDeclaration": 67, + "src": "13460:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "src": "13417:55:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "id": 1129, + "nodeType": "ExpressionStatement", + "src": "13417:55:0" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1131, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4977, + "src": "13502:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1132, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "13502:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 1133, + "name": "delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1013, + "src": "13514:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 1130, + "name": "RemoveDelegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 93, + "src": "13487:14:0", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$returns$__$", + "typeString": "function (address,address)" + } + }, + "id": 1134, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13487:36:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1135, + "nodeType": "EmitStatement", + "src": "13482:41:0" + } + ] + }, + "documentation": null, + "id": 1137, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "removeDelegate", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1014, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1013, + "name": "delegate", + "nodeType": "VariableDeclaration", + "scope": 1137, + "src": "12587:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1012, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "12587:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "12586:18:0" + }, + "returnParameters": { + "id": 1015, + "nodeType": "ParameterList", + "parameters": [], + "src": "12612:0:0" + }, + "scope": 1224, + "src": "12563:967:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 1222, + "nodeType": "Block", + "src": "13662:633:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 1157, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 1151, + "name": "results", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1147, + "src": "13672:7:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1155, + "name": "pageSize", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1143, + "src": "13696:8:0", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + ], + "id": 1154, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "NewExpression", + "src": "13682:13:0", + "typeDescriptions": { + "typeIdentifier": "t_function_objectcreation_pure$_t_uint256_$returns$_t_array$_t_address_$dyn_memory_$", + "typeString": "function (uint256) pure returns (address[] memory)" + }, + "typeName": { + "baseType": { + "id": 1152, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "13686:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 1153, + "length": null, + "nodeType": "ArrayTypeName", + "src": "13686:9:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + } + } + }, + "id": 1156, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13682:23:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory", + "typeString": "address[] memory" + } + }, + "src": "13672:33:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + "id": 1158, + "nodeType": "ExpressionStatement", + "src": "13672:33:0" + }, + { + "assignments": [ + 1160 + ], + "declarations": [ + { + "constant": false, + "id": 1160, + "name": "i", + "nodeType": "VariableDeclaration", + "scope": 1222, + "src": "13715:7:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "typeName": { + "id": 1159, + "name": "uint8", + "nodeType": "ElementaryTypeName", + "src": "13715:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 1162, + "initialValue": { + "argumentTypes": null, + "hexValue": "30", + "id": 1161, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13725:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "nodeType": "VariableDeclarationStatement", + "src": "13715:11:0" + }, + { + "assignments": [ + 1164 + ], + "declarations": [ + { + "constant": false, + "id": 1164, + "name": "initialIndex", + "nodeType": "VariableDeclaration", + "scope": 1222, + "src": "13736:19:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + }, + "typeName": { + "id": 1163, + "name": "uint48", + "nodeType": "ElementaryTypeName", + "src": "13736:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 1174, + "initialValue": { + "argumentTypes": null, + "condition": { + "argumentTypes": null, + "components": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + }, + "id": 1167, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 1165, + "name": "start", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1141, + "src": "13759:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 1166, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13768:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "13759:10:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "id": 1168, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "13758:12:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1170, + "name": "delegatesStart", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 61, + "src": "13781:14:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint48_$", + "typeString": "mapping(address => uint48)" + } + }, + "id": 1172, + "indexExpression": { + "argumentTypes": null, + "id": 1171, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1139, + "src": "13796:4:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "13781:20:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "id": 1173, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "Conditional", + "src": "13758:43:0", + "trueExpression": { + "argumentTypes": null, + "id": 1169, + "name": "start", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1141, + "src": "13773:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "13736:65:0" + }, + { + "assignments": [ + 1176 + ], + "declarations": [ + { + "constant": false, + "id": 1176, + "name": "current", + "nodeType": "VariableDeclaration", + "scope": 1222, + "src": "13811:23:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$70_memory_ptr", + "typeString": "struct AllowanceModule.Delegate" + }, + "typeName": { + "contractScope": null, + "id": 1175, + "name": "Delegate", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 70, + "src": "13811:8:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$70_storage_ptr", + "typeString": "struct AllowanceModule.Delegate" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 1182, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1177, + "name": "delegates", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 57, + "src": "13837:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_uint48_$_t_struct$_Delegate_$70_storage_$_$", + "typeString": "mapping(address => mapping(uint48 => struct AllowanceModule.Delegate storage ref))" + } + }, + "id": 1179, + "indexExpression": { + "argumentTypes": null, + "id": 1178, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1139, + "src": "13847:4:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "13837:15:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint48_$_t_struct$_Delegate_$70_storage_$", + "typeString": "mapping(uint48 => struct AllowanceModule.Delegate storage ref)" + } + }, + "id": 1181, + "indexExpression": { + "argumentTypes": null, + "id": 1180, + "name": "initialIndex", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1164, + "src": "13853:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "13837:29:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$70_storage", + "typeString": "struct AllowanceModule.Delegate storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "13811:55:0" + }, + { + "body": { + "id": 1212, + "nodeType": "Block", + "src": "13930:124:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 1198, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1193, + "name": "results", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1147, + "src": "13944:7:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + "id": 1195, + "indexExpression": { + "argumentTypes": null, + "id": 1194, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1160, + "src": "13952:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "13944:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1196, + "name": "current", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1176, + "src": "13957:7:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$70_memory_ptr", + "typeString": "struct AllowanceModule.Delegate memory" + } + }, + "id": 1197, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "delegate", + "nodeType": "MemberAccess", + "referencedDeclaration": 65, + "src": "13957:16:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "13944:29:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 1199, + "nodeType": "ExpressionStatement", + "src": "13944:29:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 1201, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "13987:3:0", + "subExpression": { + "argumentTypes": null, + "id": 1200, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1160, + "src": "13987:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "id": 1202, + "nodeType": "ExpressionStatement", + "src": "13987:3:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 1210, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 1203, + "name": "current", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1176, + "src": "14004:7:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$70_memory_ptr", + "typeString": "struct AllowanceModule.Delegate memory" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1204, + "name": "delegates", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 57, + "src": "14014:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_uint48_$_t_struct$_Delegate_$70_storage_$_$", + "typeString": "mapping(address => mapping(uint48 => struct AllowanceModule.Delegate storage ref))" + } + }, + "id": 1206, + "indexExpression": { + "argumentTypes": null, + "id": 1205, + "name": "safe", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1139, + "src": "14024:4:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "14014:15:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint48_$_t_struct$_Delegate_$70_storage_$", + "typeString": "mapping(uint48 => struct AllowanceModule.Delegate storage ref)" + } + }, + "id": 1209, + "indexExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1207, + "name": "current", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1176, + "src": "14030:7:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$70_memory_ptr", + "typeString": "struct AllowanceModule.Delegate memory" + } + }, + "id": 1208, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "next", + "nodeType": "MemberAccess", + "referencedDeclaration": 69, + "src": "14030:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "14014:29:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$70_storage", + "typeString": "struct AllowanceModule.Delegate storage ref" + } + }, + "src": "14004:39:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$70_memory_ptr", + "typeString": "struct AllowanceModule.Delegate memory" + } + }, + "id": 1211, + "nodeType": "ExpressionStatement", + "src": "14004:39:0" + } + ] + }, + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 1192, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 1188, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1183, + "name": "current", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1176, + "src": "13882:7:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$70_memory_ptr", + "typeString": "struct AllowanceModule.Delegate memory" + } + }, + "id": 1184, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "delegate", + "nodeType": "MemberAccess", + "referencedDeclaration": 65, + "src": "13882:16:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "hexValue": "30", + "id": 1186, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13910:1:0", + "subdenomination": null, + "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": 1185, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "13902:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 1187, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13902:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "src": "13882:30:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "&&", + "rightExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "id": 1191, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 1189, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1160, + "src": "13916:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "argumentTypes": null, + "id": 1190, + "name": "pageSize", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1143, + "src": "13920:8:0", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "src": "13916:12:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "13882:46:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 1213, + "nodeType": "WhileStatement", + "src": "13876:178:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 1219, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 1214, + "name": "next", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1149, + "src": "14063:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1216, + "name": "current", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1176, + "src": "14077:7:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Delegate_$70_memory_ptr", + "typeString": "struct AllowanceModule.Delegate memory" + } + }, + "id": 1217, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "delegate", + "nodeType": "MemberAccess", + "referencedDeclaration": 65, + "src": "14077:16:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 1215, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "14070:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint48_$", + "typeString": "type(uint48)" + }, + "typeName": "uint48" + }, + "id": 1218, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "14070:24:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "src": "14063:31:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "id": 1220, + "nodeType": "ExpressionStatement", + "src": "14063:31:0" + }, + { + "externalReferences": [ + { + "results": { + "declaration": 1147, + "isOffset": false, + "isSlot": false, + "src": "14268:7:0", + "valueSize": 1 + } + }, + { + "i": { + "declaration": 1160, + "isOffset": false, + "isSlot": false, + "src": "14277:1:0", + "valueSize": 1 + } + } + ], + "id": 1221, + "nodeType": "InlineAssembly", + "operations": "{ mstore(results, i) }", + "src": "14238:51:0" + } + ] + }, + "documentation": null, + "id": 1223, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getDelegates", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1144, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1139, + "name": "safe", + "nodeType": "VariableDeclaration", + "scope": 1223, + "src": "13558:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1138, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "13558:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1141, + "name": "start", + "nodeType": "VariableDeclaration", + "scope": 1223, + "src": "13572:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + }, + "typeName": { + "id": 1140, + "name": "uint48", + "nodeType": "ElementaryTypeName", + "src": "13572:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1143, + "name": "pageSize", + "nodeType": "VariableDeclaration", + "scope": 1223, + "src": "13586:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "typeName": { + "id": 1142, + "name": "uint8", + "nodeType": "ElementaryTypeName", + "src": "13586:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "13557:44:0" + }, + "returnParameters": { + "id": 1150, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1147, + "name": "results", + "nodeType": "VariableDeclaration", + "scope": 1223, + "src": "13623:24:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[]" + }, + "typeName": { + "baseType": { + "id": 1145, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "13623:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 1146, + "length": null, + "nodeType": "ArrayTypeName", + "src": "13623:9:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1149, + "name": "next", + "nodeType": "VariableDeclaration", + "scope": 1223, + "src": "13649:11:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + }, + "typeName": { + "id": 1148, + "name": "uint48", + "nodeType": "ElementaryTypeName", + "src": "13649:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint48", + "typeString": "uint48" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "13622:39:0" + }, + "scope": 1224, + "src": "13536:759:0", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + } + ], + "scope": 1225, + "src": "769:13528:0" + } + ], + "src": "0:14297:0" + }, + "compiler": { + "name": "solc", + "version": "0.5.11+commit.c082d0b4.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.3", + "updatedAt": "2020-08-13T14:18:40.132Z", + "networkType": "ethereum", + "devdoc": { + "methods": { + "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." + } + } + } + }, + "userdoc": { + "methods": {} + } +} \ No newline at end of file diff --git a/src/logic/contracts/safeContracts.ts b/src/logic/contracts/safeContracts.ts index d2992add06..164a563d13 100644 --- a/src/logic/contracts/safeContracts.ts +++ b/src/logic/contracts/safeContracts.ts @@ -1,17 +1,21 @@ -import { AbiItem } from 'web3-utils' -import contract from 'truffle-contract' -import Web3 from 'web3' -import ProxyFactorySol from '@gnosis.pm/safe-contracts/build/contracts/GnosisSafeProxyFactory.json' import GnosisSafeSol from '@gnosis.pm/safe-contracts/build/contracts/GnosisSafe.json' import SafeProxy from '@gnosis.pm/safe-contracts/build/contracts/GnosisSafeProxy.json' -import { ensureOnce } from 'src/utils/singleton' +import ProxyFactorySol from '@gnosis.pm/safe-contracts/build/contracts/GnosisSafeProxyFactory.json' import memoize from 'lodash.memoize' -import { getWeb3, getNetworkIdFrom } from 'src/logic/wallets/getWeb3' -import { calculateGasOf, calculateGasPrice } from 'src/logic/wallets/ethTransactions' -import { ZERO_ADDRESS } from 'src/logic/wallets/ethAddresses' +import contract from 'truffle-contract' +import Web3 from 'web3' +import { AbiItem } from 'web3-utils' + import { isProxyCode } from 'src/logic/contracts/historicProxyCode' -import { GnosisSafeProxyFactory } from 'src/types/contracts/GnosisSafeProxyFactory.d'; +import { ZERO_ADDRESS } from 'src/logic/wallets/ethAddresses' +import { calculateGasOf, calculateGasPrice } from 'src/logic/wallets/ethTransactions' +import { getNetworkIdFrom, getWeb3 } 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 { ensureOnce } from 'src/utils/singleton' + +import SpendingLimitModule from './artifacts/AllowanceModule.json' export const SENTINEL_ADDRESS = '0x0000000000000000000000000000000000000001' export const MULTI_SEND_ADDRESS = '0x8d29be29923b68abfdd21e541b9374737b49cdad' @@ -37,7 +41,13 @@ const createProxyFactoryContract = (web3: Web3, networkId: number): GnosisSafePr return proxyFactory } +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 b49b2aa17c..8fb8e6f061 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 7d4536afa7..9a21310b71 100644 --- a/src/logic/notifications/notificationTypes.ts +++ b/src/logic/notifications/notificationTypes.ts @@ -46,6 +46,18 @@ const NOTIFICATION_IDS = { SETTINGS_CHANGE_EXECUTED_MSG: 'SETTINGS_CHANGE_EXECUTED_MSG', SETTINGS_CHANGE_EXECUTED_MORE_CONFIRMATIONS_MSG: 'SETTINGS_CHANGE_EXECUTED_MORE_CONFIRMATIONS_MSG', SETTINGS_CHANGE_FAILED_MSG: 'SETTINGS_CHANGE_FAILED_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', RINKEBY_VERSION_MSG: 'RINKEBY_VERSION_MSG', WRONG_NETWORK_MSG: 'WRONG_NETWORK_MSG', ADDRESS_BOOK_NEW_ENTRY_SUCCESS: 'ADDRESS_BOOK_NEW_ENTRY_SUCCESS', @@ -192,6 +204,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 tx', + options: { variant: INFO, persist: true }, + }, + NEW_SPENDING_LIMIT_PENDING_MSG: { + message: 'New Spending Limit tx pending', + options: { variant: INFO, persist: true }, + }, + NEW_SPENDING_LIMIT_REJECTED_MSG: { + message: 'New Spending Limit tx rejected', + options: { variant: ERROR, persist: false, autoHideDuration: longDuration }, + }, + NEW_SPENDING_LIMIT_EXECUTED_MSG: { + message: 'New Spending Limit tx successfully executed', + options: { variant: SUCCESS, persist: false, autoHideDuration: longDuration }, + }, + NEW_SPENDING_LIMIT_EXECUTED_MORE_CONFIRMATIONS_MSG: { + message: 'New Spending Limit tx successfully created. More confirmations needed to execute', + options: { variant: SUCCESS, persist: false, autoHideDuration: longDuration }, + }, + NEW_SPENDING_LIMIT_FAILED_MSG: { + message: 'New Spending Limit tx failed', + options: { variant: ERROR, persist: false, autoHideDuration: longDuration }, + }, + SIGN_REMOVE_SPENDING_LIMIT_MSG: { + message: 'Please sign the remove Spending Limit tx', + options: { variant: INFO, persist: true }, + }, + REMOVE_SPENDING_LIMIT_PENDING_MSG: { + message: 'Remove Spending Limit tx pending', + options: { variant: INFO, persist: true }, + }, + REMOVE_SPENDING_LIMIT_REJECTED_MSG: { + message: 'Remove Spending Limit tx rejected', + options: { variant: ERROR, persist: false, autoHideDuration: longDuration }, + }, + REMOVE_SPENDING_LIMIT_EXECUTED_MSG: { + message: 'Remove Spending Limit tx successfully executed', + options: { variant: SUCCESS, persist: false, autoHideDuration: longDuration }, + }, + REMOVE_SPENDING_LIMIT_EXECUTED_MORE_CONFIRMATIONS_MSG: { + message: 'Remove Spending Limit tx successfully created. More confirmations needed to execute', + options: { variant: SUCCESS, persist: false, autoHideDuration: longDuration }, + }, + REMOVE_SPENDING_LIMIT_FAILED_MSG: { + message: 'Remove Spending Limit tx failed', + options: { variant: ERROR, persist: false, autoHideDuration: longDuration }, + }, + // Network RINKEBY_VERSION_MSG: { message: "Rinkeby Version: Don't send Mainnet assets to this Safe", diff --git a/src/logic/safe/store/actions/fetchSafe.ts b/src/logic/safe/store/actions/fetchSafe.ts index bd95676e90..22fc29635c 100644 --- a/src/logic/safe/store/actions/fetchSafe.ts +++ b/src/logic/safe/store/actions/fetchSafe.ts @@ -11,12 +11,17 @@ import addSafeOwner from 'src/logic/safe/store/actions/addSafeOwner' import removeSafeOwner from 'src/logic/safe/store/actions/removeSafeOwner' import updateSafe from 'src/logic/safe/store/actions/updateSafe' import { makeOwner } from 'src/logic/safe/store/models/owner' +import { + requestAllowancesByDelegatesAndTokens, + requestTokensByDelegate, +} from 'src/routes/safe/components/Settings/SpendingLimit/utils' import { checksumAddress } from 'src/utils/checksumAddress' -import { ModulePair, SafeOwner, SafeRecordProps } from 'src/logic/safe/store/models/safe' +import { ModulePair, SafeOwner, SafeRecordProps, SpendingLimit } from 'src/logic/safe/store/models/safe' import { Action, Dispatch } from 'redux' -import { SENTINEL_ADDRESS } from 'src/logic/contracts/safeContracts' +import { getSpendingLimitContract, SENTINEL_ADDRESS } from 'src/logic/contracts/safeContracts' import { AppReduxState } from 'src/store' +import { SPENDING_LIMIT_MODULE_ADDRESS } from 'src/utils/constants' const buildOwnersFrom = (safeOwners: string[], localSafe: SafeRecordProps): List => { const ownersList = safeOwners.map((ownerAddress) => { @@ -84,6 +89,7 @@ export const buildSafe = async ( currentVersion, needsUpdate, featuresEnabled, + spendingLimits: null, balances: Map(), latestIncomingTxBlock: null, activeAssets: Set(), @@ -94,8 +100,22 @@ export const buildSafe = async ( } } +const getSpendingLimits = async (modules, safeAddress: string): Promise => { + const isSpendingLimitEnabled = + modules?.array?.some((module) => module.toLowerCase() === SPENDING_LIMIT_MODULE_ADDRESS.toLowerCase()) ?? 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 +} + export const checkAndUpdateSafe = (safeAdd: string) => async (dispatch: Dispatch): Promise => { const safeAddress = checksumAddress(safeAdd) + // Check if the owner's safe did change and update them const safeParams = [ 'getThreshold', @@ -104,15 +124,21 @@ export const checkAndUpdateSafe = (safeAdd: string) => async (dispatch: Dispatch // TODO: 100 is an arbitrary large number, to avoid the need for pagination. But pagination must be properly handled { method: 'getModulesPaginated', args: [SENTINEL_ADDRESS, 100] }, ] + + const safeInfo = generateBatchRequests({ + abi: GnosisSafeSol.abi, + address: safeAddress, + methods: safeParams, + }) + const [[remoteThreshold, remoteNonce, remoteOwners, modules], localSafe] = await Promise.all([ - generateBatchRequests({ - abi: GnosisSafeSol.abi, - address: safeAddress, - methods: safeParams, - }), + safeInfo, getLocalSafe(safeAddress), ]) + // request SpendingLimit info + const spendingLimits = await getSpendingLimits(modules, safeAddress) + // Converts from [ { address, ownerName} ] to address array const localOwners = localSafe ? localSafe.owners.map((localOwner) => localOwner.address) : undefined @@ -120,6 +146,7 @@ export const checkAndUpdateSafe = (safeAdd: string) => async (dispatch: Dispatch updateSafe({ address: safeAddress, modules: buildModulesLinkedList(modules?.array, modules?.next), + spendingLimits, nonce: Number(remoteNonce), threshold: Number(remoteThreshold), }), diff --git a/src/logic/safe/store/models/safe.ts b/src/logic/safe/store/models/safe.ts index 0311d3be2c..d8296329ba 100644 --- a/src/logic/safe/store/models/safe.ts +++ b/src/logic/safe/store/models/safe.ts @@ -7,6 +7,16 @@ export type SafeOwner = { export type ModulePair = [string, 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 @@ -14,6 +24,7 @@ export type SafeRecordProps = { ethBalance: string owners: List modules: ModulePair[] | null + spendingLimits: SpendingLimit[] | null activeTokens: Set activeAssets: Set blacklistedTokens: Set @@ -34,6 +45,7 @@ const makeSafe = Record({ ethBalance: '0', owners: List([]), modules: [], + spendingLimits: [], activeTokens: Set(), activeAssets: Set(), blacklistedTokens: Set(), diff --git a/src/logic/safe/store/selectors/index.ts b/src/logic/safe/store/selectors/index.ts index 9c6d3f9c59..f133288d46 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 getActiveTokensAddressesForAllSafes = createSelector(safesListSelector, (safes) => { const addresses = Set().withMutations((set) => { safes.forEach((safe) => { diff --git a/src/logic/safe/transactions/notifiedTransactions.ts b/src/logic/safe/transactions/notifiedTransactions.ts index 83700fd98e..79867eddd1 100644 --- a/src/logic/safe/transactions/notifiedTransactions.ts +++ b/src/logic/safe/transactions/notifiedTransactions.ts @@ -4,6 +4,8 @@ export const TX_NOTIFICATION_TYPES: any = { 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', 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 6079daefc4..29ea088105 100644 --- a/src/routes/safe/components/Balances/SendModal/screens/AddressBookInput/index.tsx +++ b/src/routes/safe/components/Balances/SendModal/screens/AddressBookInput/index.tsx @@ -1,6 +1,5 @@ import MuiTextField from '@material-ui/core/TextField' -import { withStyles } from '@material-ui/core/styles' -import makeStyles from '@material-ui/core/styles/makeStyles' +import { makeStyles } from '@material-ui/core/styles' import Autocomplete from '@material-ui/lab/Autocomplete' import { List } from 'immutable' import React, { useEffect, useState } from 'react' @@ -24,7 +23,8 @@ export interface AddressBookProps { setSelectedEntry: ( entry: { address?: string; name?: string } | React.SetStateAction<{ address: string; name: string }>, ) => void - setIsValidAddress: (valid?: boolean) => void + setIsValidAddress?: (valid?: boolean) => void + label?: string } const useStyles = makeStyles(styles) @@ -67,11 +67,12 @@ interface FilteredAddressBookEntry { const AddressBookInput = ({ fieldMutator, isCustomTx, + label = 'Recipient', pristine, recipientAddress, setIsValidAddress, setSelectedEntry, -}: AddressBookProps) => { +}: AddressBookProps): React.ReactElement => { const classes = useStyles() const addressBook = useSelector(getAddressBook) const [isValidForm, setIsValidForm] = useState(true) @@ -90,7 +91,7 @@ const AddressBookInput = ({ if (inputTouched && !normalizedAddress) { setIsValidForm(false) setValidationText('Required') - setIsValidAddress(false) + setIsValidAddress?.(false) return } if (normalizedAddress) { @@ -121,7 +122,7 @@ const AddressBookInput = ({ setIsValidForm(isValidText === undefined) setValidationText(isValidText) fieldMutator(resolvedAddress) - setIsValidAddress(isValidText === undefined) + setIsValidAddress?.(isValidText === undefined) } useEffect(() => { @@ -201,7 +202,7 @@ const AddressBookInput = ({ }, className: statusClasses, }} - label={!isValidForm ? validationText : 'Recipient'} + label={!isValidForm ? validationText : label} onChange={(event) => { setInputTouched(true) onAddressInputChanged(event.target.value) @@ -232,4 +233,4 @@ const AddressBookInput = ({ ) } -export default withStyles(styles as any)(AddressBookInput) +export default AddressBookInput 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 d33974ed40..02b50b561b 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,8 +1,11 @@ +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 { makeStyles } from '@material-ui/core/styles' +import { List } from 'immutable' import React from 'react' +import { Token } from 'src/logic/tokens/store/model/token' import { selectStyles, selectedTokenStyles } from './style' @@ -10,12 +13,19 @@ 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' -const SelectedToken = ({ classes, tokenAddress, tokens }) => { +const useSelectedTokenStyles = makeStyles(selectedTokenStyles) + +interface SelectTokenProps { + tokenAddress: string + tokens: List +} + +const SelectedToken = ({ tokenAddress, tokens }: SelectTokenProps): React.ReactElement => { + const classes = useSelectedTokenStyles() const token = tokens.find(({ address }) => address === tokenAddress) return ( @@ -28,43 +38,54 @@ 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} - - - - ))} - -) +const useSelectStyles = makeStyles(selectStyles) + +interface TokenSelectFieldProps { + initialValue?: string + isValid?: boolean + tokens: List +} + +const TokenSelectField = ({ initialValue, isValid = true, tokens }: TokenSelectFieldProps): React.ReactElement => { + const classes = useSelectStyles() + + return ( + } + validate={required} + > + {tokens.map((token) => ( + + + {token.name} + + + + ))} + + ) +} -export default withStyles(selectStyles)(TokenSelectField) +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 561dd1691d..f5bd385d93 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,6 +1,8 @@ +import { createStyles } from '@material-ui/core' + import { sm } from 'src/theme/variables' -export const selectedTokenStyles = () => ({ +export const selectedTokenStyles = createStyles({ container: { minHeight: '55px', padding: 0, @@ -16,7 +18,7 @@ export const selectedTokenStyles = () => ({ }, }) -export const selectStyles = () => ({ +export const selectStyles = createStyles({ selectMenu: { paddingRight: 0, }, 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 0000000000..9b4a935f68 --- /dev/null +++ b/src/routes/safe/components/Settings/SpendingLimit/FormFields/Amount.tsx @@ -0,0 +1,58 @@ +import { TextField as SRCTextField } from '@gnosis.pm/safe-react-components' +import React 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 = (): React.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 0000000000..5b519a3f40 --- /dev/null +++ b/src/routes/safe/components/Settings/SpendingLimit/FormFields/Beneficiary.tsx @@ -0,0 +1,105 @@ +import { EthHashInfo } from '@gnosis.pm/safe-react-components' +import React 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 { getNetwork } from 'src/config' +import { getAddressBook } from 'src/logic/addressBook/store/selectors' +import { getNameFromAdbk } from 'src/logic/addressBook/utils' +import AddressBookInput from 'src/routes/safe/components/Balances/SendModal/screens/AddressBookInput' + +import { KEYCODES } from 'src/routes/safe/components/Settings/SpendingLimit/utils' + +const BeneficiaryInput = styled.div` + grid-area: beneficiaryInput; +` + +const BeneficiaryScan = styled.div` + grid-area: beneficiaryScan; +` + +const Beneficiary = (): React.ReactElement => { + const { initialValues } = useFormState() + const { mutators } = useForm() + + const [selectedEntry, setSelectedEntry] = React.useState<{ address: string; name: string } | null>({ + address: initialValues?.beneficiary || '', + name: '', + }) + + const [pristine, setPristine] = React.useState(!initialValues?.beneficiary) + + React.useEffect(() => { + if (selectedEntry === null) { + mutators?.setBeneficiary?.('') + + if (pristine) { + setPristine(false) + } + } + }, [mutators, pristine, selectedEntry]) + + const addressBook = useSelector(getAddressBook) + + const handleScan = (value, closeQrModal) => { + const scannedAddress = value.startsWith('ethereum:') ? value.replace('ethereum:', '') : value + const scannedName = addressBook ? getNameFromAdbk(addressBook, scannedAddress) : '' + + mutators?.setBeneficiary?.(scannedAddress) + + setSelectedEntry({ + name: scannedName, + address: scannedAddress, + }) + + closeQrModal() + } + + const handleOnKeyDown = (e: React.KeyboardEvent): void => { + if (![KEYCODES.TAB, KEYCODES.SHIFT].includes(e.keyCode)) { + setSelectedEntry(null) + } + } + + const handleOnClick = () => { + setSelectedEntry(null) + } + + return selectedEntry !== null && selectedEntry.address ? ( + + + + ) : ( + <> + + + + + + + + ) +} + +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 0000000000..46c5c033b3 --- /dev/null +++ b/src/routes/safe/components/Settings/SpendingLimit/FormFields/ResetTime.tsx @@ -0,0 +1,116 @@ +import { RadioButtons, Text } from '@gnosis.pm/safe-react-components' +import { FormControlLabel, hexToRgb, Switch as SwitchMui } from '@material-ui/core' +import React 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): React.ReactElement => ( + + {({ input: { name, value, onChange } }) => ( + + )} + +) + +const Switch = ({ label, name }: { label: string; name: string }): React.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 = (): React.ReactElement => { + const { + input: { value: withResetTime }, + } = useField('withResetTime', { subscription: { value: true } }) + + return ( + <> + + Set a reset-time to have the allowance automatically refill after a 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 0000000000..381229c4ff --- /dev/null +++ b/src/routes/safe/components/Settings/SpendingLimit/FormFields/Token.tsx @@ -0,0 +1,21 @@ +import React from 'react' +import { useSelector } from 'react-redux' +import TokenSelectField from 'src/routes/safe/components/Balances/SendModal/screens/SendFunds/TokenSelectField' +import { extendedSafeTokensSelector } from 'src/routes/safe/container/selector' +import styled from 'styled-components' + +const TokenInput = styled.div` + grid-area: tokenInput; +` + +const Token = (): React.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 0000000000..555ac53768 --- /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 0000000000..eae0f7016d --- /dev/null +++ b/src/routes/safe/components/Settings/SpendingLimit/InfoDisplay/AddressInfo.tsx @@ -0,0 +1,35 @@ +import { EthHashInfo } from '@gnosis.pm/safe-react-components' +import React from 'react' +import { useSelector } from 'react-redux' + +import { getNetwork } from 'src/config' +import { getNameFromAddressBook } from 'src/logic/addressBook/store/selectors' + +import DataDisplay from './DataDisplay' + +interface AddressInfoProps { + address: string + cut?: number + title?: string +} + +const AddressInfo = ({ address, cut = 4, title }: AddressInfoProps): React.ReactElement => { + const name = useSelector((state) => getNameFromAddressBook(state, 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 0000000000..669ea560b4 --- /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 from 'react' + +interface GenericInfoProps { + title?: string + children: React.ReactNode +} + +const DataDisplay = ({ title, children }: GenericInfoProps): React.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 0000000000..e12c717411 --- /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 from 'react' + +import Row from 'src/components/layout/Row' + +import DataDisplay from './DataDisplay' + +interface ResetTimeInfoProps { + title?: string + label?: string +} + +const ResetTimeInfo = ({ title, label }: ResetTimeInfoProps): React.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 0000000000..14d5e93e21 --- /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 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): React.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 0000000000..2d6b7eb13d --- /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 0000000000..bcac4da0c4 --- /dev/null +++ b/src/routes/safe/components/Settings/SpendingLimit/LimitsTable/SpentVsAmount.tsx @@ -0,0 +1,61 @@ +import { Text } from '@gnosis.pm/safe-react-components' +import React 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 useToken from 'src/routes/safe/components/Settings/SpendingLimit/hooks/useToken' +import { fromTokenUnit } from 'src/routes/safe/components/Settings/SpendingLimit/utils' +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; token?: Token } + +type FormattedAmounts = { amount: string; spent: string } + +const useFormattedAmounts = ({ amount, spent, token }: FormattedAmountsProps): FormattedAmounts => { + return React.useMemo(() => { + if (token) { + const formattedSpent = formatAmount(fromTokenUnit(spent, token.decimals)).toString() + const formattedAmount = formatAmount(fromTokenUnit(amount, token.decimals)).toString() + return { amount: formattedAmount, spent: formattedSpent } + } + + return null + }, [amount, spent, token]) +} + +interface SpentVsAmountProps { + amount: string + spent: string + tokenAddress: string +} + +const SpentVsAmount = ({ amount, spent, tokenAddress }: SpentVsAmountProps): React.ReactElement => { + const { width } = useWindowDimensions() + const showIcon = React.useMemo(() => width > 1024, [width]) + + const token = useToken(tokenAddress) + const spentInfo = useFormattedAmounts({ amount, spent, token }) + + return spentInfo ? ( + + {showIcon && } + {`${spentInfo.spent} of ${spentInfo.amount} ${token.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 0000000000..dd1cfb1d9c --- /dev/null +++ b/src/routes/safe/components/Settings/SpendingLimit/LimitsTable/dataFetcher.ts @@ -0,0 +1,95 @@ +import { formatRelative } from 'date-fns' +import { List } from 'immutable' + +import { TableColumn } from 'src/components/Table/types.d' + +import { SpendingLimitRow } from 'src/routes/safe/components/Settings/SpendingLimit/utils' + +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 SpentTableInfo = { + spent: string + amount: string + tokenAddress: string +} + +export type ResetTimeInfo = { + relativeTime: string + lastResetMin: string + resetTimeMin: string +} + +export type SpendingLimitTable = { + [SPENDING_LIMIT_TABLE_BENEFICIARY_ID]: string + [SPENDING_LIMIT_TABLE_SPENT_ID]: SpentTableInfo + [SPENDING_LIMIT_TABLE_RESET_TIME_ID]: ResetTimeInfo +} + +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()) +} + +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 0000000000..7502088996 --- /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 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): React.ReactElement => { + const classes = useStyles() + const granted = useSelector(grantedSelector) + + const columns = generateColumns() + const autoColumns = columns.filter(({ custom }) => !custom) + + const [selectedRow, setSelectedRow] = React.useState(null) + + 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 !== null && ( + setSelectedRow(null)} 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 0000000000..2837d00ac2 --- /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 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): React.ReactElement => ( + + + {title} + {titleNote && ( + <> + {' '} + <Text size="lg" color="secondaryLight"> + {titleNote} + </Text> + </> + )} + + + + + + +) + +interface FooterProps { + children: React.ReactNodeArray +} + +const Footer = ({ children }: FooterProps): React.ReactElement => ( + + {children} + +) + +export interface ModalProps { + children: React.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 ban be part of the form body +const Modal = ({ children, ...props }: ModalProps): React.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 0000000000..d604302727 --- /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 { Mutator } from 'final-form' +import React 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; + 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 }, +}): boolean => !(submitting || invalid || !beneficiary || !token || !amount || !dirtyFieldsSinceLastSubmit) + +const Create = ({ initialValues, onCancel, onReview }: NewSpendingLimitProps): React.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 0000000000..ecdef8370f --- /dev/null +++ b/src/routes/safe/components/Settings/SpendingLimit/NewLimitModal/Review.tsx @@ -0,0 +1,214 @@ +import { Button, Text } from '@gnosis.pm/safe-react-components' +import React 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 { + getGnosisSafeInstanceAt, + getSpendingLimitContract, + MULTI_SEND_ADDRESS, +} from 'src/logic/contracts/safeContracts' +import createTransaction from 'src/logic/safe/store/actions/createTransaction' +import { SpendingLimit } from 'src/logic/safe/store/models/safe' +import { safeParamAddressFromStateSelector, safeSpendingLimitsSelector } from 'src/logic/safe/store/selectors' +import { DELEGATE_CALL, TX_NOTIFICATION_TYPES } from 'src/logic/safe/transactions' +import { getEncodedMultiSendCallData } from 'src/logic/safe/utils/upgradeSafe' +import { Token } from 'src/logic/tokens/store/model/token' +import { ETH_ADDRESS } from 'src/logic/tokens/utils/tokenHelpers' +import { ZERO_ADDRESS } from 'src/logic/wallets/ethAddresses' +import { getWeb3 } from 'src/logic/wallets/getWeb3' +import { SPENDING_LIMIT_MODULE_ADDRESS } from 'src/utils/constants' + +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 { + adjustAmountToToken, + currentMinutes, + fromTokenUnit, + SpendingLimitRow, + toTokenUnit, +} from 'src/routes/safe/components/Settings/SpendingLimit/utils' + +interface ReviewSpendingLimitProps { + onBack: () => void + onClose: () => void + txToken: Token | null + values: Record + existentSpendingLimit?: SpendingLimitRow +} + +const Review = ({ onBack, onClose, txToken, values }: ReviewSpendingLimitProps): React.ReactElement => { + const classes = useStyles() + + const dispatch = useDispatch() + + const safeAddress = useSelector(safeParamAddressFromStateSelector) + const spendingLimits = useSelector(safeSpendingLimitsSelector) + + // undefined: before setting a value + // null: if no previous value + // SpendingLimit: if previous value exists + const [existentSpendingLimit, setExistentSpendingLimit] = React.useState() + React.useEffect(() => { + const checkExistence = async () => { + // if `delegate` already exist, check what tokens were delegated to the _beneficiary_ `getTokens(safe, delegate)` + const currentDelegate = spendingLimits?.find( + ({ delegate, token }) => + delegate.toLowerCase() === values.beneficiary.toLowerCase() && + token.toLowerCase() === (values.token === ETH_ADDRESS ? ZERO_ADDRESS : values.token.toLowerCase()), + ) + + // let the user know that is about to replace an existent allowance + if (currentDelegate !== undefined) { + setExistentSpendingLimit({ + ...currentDelegate, + amount: fromTokenUnit(currentDelegate.amount, txToken.decimals), + }) + } else { + setExistentSpendingLimit(null) + } + } + + checkExistence() + }, [spendingLimits, txToken.decimals, values.beneficiary, values.token]) + + const handleSubmit = async () => { + const spendingLimitContract = getSpendingLimitContract() + const isSpendingLimitEnabled = spendingLimits !== null + + const transactions = [] + + // is spendingLimit module enabled? -> if not, create the tx to enable it, and encode it + if (!isSpendingLimitEnabled) { + const safeInstance = await getGnosisSafeInstanceAt(safeAddress) + transactions.push({ + to: safeAddress, + value: 0, + data: safeInstance.methods.enableModule(SPENDING_LIMIT_MODULE_ADDRESS).encodeABI(), + }) + } + + // 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 }) => delegate.toLowerCase() === values?.beneficiary.toLowerCase()) ?? false + + // if `delegate` does not exist, add it by calling `addDelegate(beneficiary)` + if (!isDelegateAlreadyAdded && values?.beneficiary) { + transactions.push({ + to: SPENDING_LIMIT_MODULE_ADDRESS, + value: 0, + data: spendingLimitContract.methods.addDelegate(values?.beneficiary).encodeABI(), + }) + } + + // prepare the setAllowance tx + const startTime = currentMinutes() - 30 + const setAllowanceTx = { + to: SPENDING_LIMIT_MODULE_ADDRESS, + value: 0, + data: spendingLimitContract.methods + .setAllowance( + values.beneficiary, + values.token === ETH_ADDRESS ? ZERO_ADDRESS : values.token, + toTokenUnit(values.amount, txToken.decimals), + values.withResetTime ? +values.resetTime * 60 * 24 : 0, + values.withResetTime ? startTime : 0, + ) + .encodeABI(), + } + + // if there's no tx for enable module or adding a delegate, then we avoid using multiSend Tx + if (transactions.length === 0) { + dispatch( + createTransaction({ + safeAddress, + to: SPENDING_LIMIT_MODULE_ADDRESS, + valueInWei: '0', + txData: setAllowanceTx.data, + notifiedTransaction: TX_NOTIFICATION_TYPES.NEW_SPENDING_LIMIT_TX, + }), + ) + } else { + transactions.push(setAllowanceTx) + + dispatch( + createTransaction({ + safeAddress, + to: MULTI_SEND_ADDRESS, + valueInWei: '0', + txData: getEncodedMultiSendCallData(transactions, getWeb3()), + notifiedTransaction: TX_NOTIFICATION_TYPES.NEW_SPENDING_LIMIT_TX, + operation: DELEGATE_CALL, + }), + ) + } + } + + const resetTimeLabel = React.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 0000000000..97d4623166 --- /dev/null +++ b/src/routes/safe/components/Settings/SpendingLimit/NewLimitModal/index.tsx @@ -0,0 +1,101 @@ +import { List } from 'immutable' +import React from 'react' +import { useSelector } from 'react-redux' + +import { Token } from 'src/logic/tokens/store/model/token' +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' + +const CREATE = 'CREATE' as const +const REVIEW = 'REVIEW' as const + +type Step = typeof CREATE | typeof REVIEW + +type State = { + step?: Step + values?: Record | null + txToken?: Token | null +} + +type Action = { + type: Step + newState?: State + tokens?: List +} + +const newLimitModalReducer = (state: State, action: Action) => { + 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) => token.address === newState.values.token) ?? null, + step: REVIEW, + } + } + } +} + +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] = React.useReducer(newLimitModalReducer, { + step: initialStep, + values: null, + txToken: null, + }) + + // define actions + const create = React.useCallback(() => dispatch({ type: CREATE }), []) + const review = React.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): React.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({ 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 0000000000..0e5b2e9566 --- /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 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 = (): React.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 0000000000..0a1cd7bd1d --- /dev/null +++ b/src/routes/safe/components/Settings/SpendingLimit/RemoveLimitModal.tsx @@ -0,0 +1,113 @@ +import { Button } from '@gnosis.pm/safe-react-components' +import React from 'react' +import { useDispatch, useSelector } from 'react-redux' + +import Block from 'src/components/layout/Block' +import Col from 'src/components/layout/Col' +import SpendingLimitModule from 'src/logic/contracts/artifacts/AllowanceModule.json' +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 { ETH_ADDRESS } from 'src/logic/tokens/utils/tokenHelpers' +import { ZERO_ADDRESS } from 'src/logic/wallets/ethAddresses' +import { getWeb3 } from 'src/logic/wallets/getWeb3' +import useToken from 'src/routes/safe/components/Settings/SpendingLimit/hooks/useToken' +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' +import { fromTokenUnit } from './utils' + +interface RemoveSpendingLimitModalProps { + onClose: () => void + spendingLimit: SpendingLimitTable + open: boolean +} + +const RemoveLimitModal = ({ onClose, spendingLimit, open }: RemoveSpendingLimitModalProps): React.ReactElement => { + const classes = useStyles() + + const tokenInfo = useToken(spendingLimit.spent.tokenAddress) + + const safeAddress = useSelector(safeParamAddressFromStateSelector) + const dispatch = useDispatch() + + const removeSelectedSpendingLimit = async (): Promise => { + try { + const web3 = getWeb3() + const spendingLimitContract = new web3.eth.Contract(SpendingLimitModule.abi as any, SPENDING_LIMIT_MODULE_ADDRESS) + const { + beneficiary, + spent: { tokenAddress }, + } = spendingLimit + + // TODO: replace with a proper way to remove allowances. + // as we don't have a current way to remove an allowance, we tweak it by setting its `amount` and `resetTimeMin` to 0 + // This is directly related to `discardZeroAllowance` + const txData = spendingLimitContract.methods + .setAllowance(beneficiary, tokenAddress === ETH_ADDRESS ? ZERO_ADDRESS : tokenAddress, 0, 0, 0) + .encodeABI() + + 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/hooks/useToken.tsx b/src/routes/safe/components/Settings/SpendingLimit/hooks/useToken.tsx new file mode 100644 index 0000000000..27b4b38098 --- /dev/null +++ b/src/routes/safe/components/Settings/SpendingLimit/hooks/useToken.tsx @@ -0,0 +1,21 @@ +import React from 'react' +import { useSelector } from 'react-redux' +import { Token } from 'src/logic/tokens/store/model/token' +import { ETH_ADDRESS } from 'src/logic/tokens/utils/tokenHelpers' +import { ZERO_ADDRESS } from 'src/logic/wallets/ethAddresses' +import { extendedSafeTokensSelector } from 'src/routes/safe/container/selector' + +const useToken = (address: string): Token => { + const tokens = useSelector(extendedSafeTokensSelector) + + return React.useMemo(() => { + if (tokens) { + const tokenAddress = address === ZERO_ADDRESS ? ETH_ADDRESS : address + return tokens.find((token) => token.address === tokenAddress) ?? null + } + + return null + }, [address, tokens]) +} + +export default useToken diff --git a/src/routes/safe/components/Settings/SpendingLimit/index.tsx b/src/routes/safe/components/Settings/SpendingLimit/index.tsx index 26251d949e..b11eb350dc 100644 --- a/src/routes/safe/components/Settings/SpendingLimit/index.tsx +++ b/src/routes/safe/components/Settings/SpendingLimit/index.tsx @@ -1,52 +1,41 @@ -import { Text, Title } from '@gnosis.pm/safe-react-components' -import { makeStyles } from '@material-ui/core/styles' +import { Button, Text, Title } from '@gnosis.pm/safe-react-components' import React from 'react' +import { useSelector } from 'react-redux' import styled from 'styled-components' -import { styles } from './style' -import Beneficiary from './assets/beneficiary.svg' -import AssetAmount from './assets/asset-amount.svg' -import Time from './assets/time.svg' - import Block from 'src/components/layout/Block' -import Img from 'src/components/layout/Img' -import Row from 'src/components/layout/Row' import Col from 'src/components/layout/Col' -import Button from 'src/components/layout/Button' +import Row from 'src/components/layout/Row' +import { safeSpendingLimitsSelector } from 'src/logic/safe/store/selectors' +import { grantedSelector } from 'src/routes/safe/container/selector' -const useStyles = makeStyles(styles) +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 Steps = styled.div` - display: flex; - justify-content: space-around; - margin-top: 20px; - max-width: 720px; - text-align: center; -` - -const StepsLine = styled.div` - height: 2px; - flex: 1; - background: #d4d5d3; - margin: 46px 0; -` - -const SpendingLimitStep = styled.div` - width: 24%; - min-width: 120px; - max-width: 164px; -` - -const SpendingLimit = (): React.ReactElement => { +const SpendingLimitSettings = (): React.ReactElement => { const classes = useStyles() + const granted = useSelector(grantedSelector) + const allowances = useSelector(safeSpendingLimitsSelector) + const spendingLimitData = getSpendingLimitData(allowances) + + const [showNewSpendingLimitModal, setShowNewSpendingLimitModal] = React.useState(false) + const openNewSpendingLimitModal = () => { + setShowNewSpendingLimitModal(true) + } + const closeNewSpendingLimitModal = () => { + setShowNewSpendingLimitModal(false) + } return ( <> - + Spending Limit @@ -54,59 +43,30 @@ const SpendingLimit = (): React.ReactElement => { You can set rules for specific beneficiaries to access funds from this Safe without having to collect all signatures. - - - 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 - - - + {spendingLimitData?.length ? : } - - - - - + + {granted && ( + <> + + + + + + {showNewSpendingLimitModal && } + + )} ) } -export default SpendingLimit +export default SpendingLimitSettings diff --git a/src/routes/safe/components/Settings/SpendingLimit/style.ts b/src/routes/safe/components/Settings/SpendingLimit/style.ts index 43cb78c445..35b2f9c20c 100644 --- a/src/routes/safe/components/Settings/SpendingLimit/style.ts +++ b/src/routes/safe/components/Settings/SpendingLimit/style.ts @@ -1,4 +1,4 @@ -import { createStyles } from '@material-ui/core' +import { createStyles, makeStyles } from '@material-ui/core' import { background, boldFont, @@ -13,116 +13,120 @@ import { xl, } from 'src/theme/variables' -export const styles = createStyles({ - title: { - padding: lg, - paddingBottom: 0, - }, - hide: { - '&:hover': { - backgroundColor: '#fff3e2', - }, - '&:hover $actions': { - visibility: 'initial', - }, - }, - actions: { - justifyContent: 'flex-end', - visibility: 'hidden', - minWidth: '100px', - }, - 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': { +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', }, - }, - modal: { - height: 'auto', - maxWidth: 'calc(100% - 30px)', - overflow: 'hidden', - }, -}) + 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/SpendingLimit/utils.ts b/src/routes/safe/components/Settings/SpendingLimit/utils.ts new file mode 100644 index 0000000000..66ce0290ad --- /dev/null +++ b/src/routes/safe/components/Settings/SpendingLimit/utils.ts @@ -0,0 +1,142 @@ +import GnosisSafeSol from '@gnosis.pm/safe-contracts/build/contracts/GnosisSafe.json' +import { BigNumber } from 'bignumber.js' + +import SpendingLimitModule from 'src/logic/contracts/artifacts/AllowanceModule.json' +import generateBatchRequests from 'src/logic/contracts/generateBatchRequests' +import { SENTINEL_ADDRESS } from 'src/logic/contracts/safeContracts' +import { web3ReadOnly } from 'src/logic/wallets/getWeb3' +import { SPENDING_LIMIT_MODULE_ADDRESS } from 'src/utils/constants' + +export const KEYCODES = { + TAB: 9, + SHIFT: 16, +} + +export const fromTokenUnit = (amount: string, decimals: string | number): string => + new BigNumber(amount).times(`1e-${decimals}`).toFixed() + +export const toTokenUnit = (amount: string, decimals: string | number): string => { + const amountBN = new BigNumber(amount).times(`1e${decimals}`) + const [, amountDecimalPlaces] = amount.split('.') + + if (amountDecimalPlaces?.length >= +decimals) { + return amountBN.toFixed(0, BigNumber.ROUND_DOWN) + } + + return amountBN.toFixed() +} + +export const adjustAmountToToken = (amount: string, decimals: string | number): string => { + const amountBN = new BigNumber(amount) + const [, amountDecimalPlaces] = amount.split('.') + + if (amountDecimalPlaces?.length >= 18) { + return amountBN.toFixed(+decimals, BigNumber.ROUND_DOWN) + } + + return amountBN.toFixed() +} + +export const currentMinutes = (): number => Math.floor(Date.now() / (1000 * 60)) + +export const requestModuleData = (safeAddress: string): Promise => { + const batch = new web3ReadOnly.BatchRequest() + + const requests = [ + { + abi: GnosisSafeSol.abi, + address: safeAddress, + methods: [{ method: 'getModulesPaginated', args: [SENTINEL_ADDRESS, 100] }], + batch, + }, + { + abi: SpendingLimitModule.abi, + address: SPENDING_LIMIT_MODULE_ADDRESS, + methods: [{ method: 'getDelegates', args: [safeAddress, 0, 100] }], + batch, + }, + ] + + const whenRequestsValues = requests.map(generateBatchRequests) + + batch.execute() + + return Promise.all(whenRequestsValues).then(([modules, delegates]) => [modules[0], delegates[0]]) +} + +export const requestTokensByDelegate = async (safeAddress: string, delegates: string[]): Promise => { + const batch = new web3ReadOnly.BatchRequest() + + const whenRequestValues = delegates.map((delegateAddress: string) => + generateBatchRequests({ + abi: SpendingLimitModule.abi, + 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 +} + +/** + * TODO: This is hopefully a temp function that attempts to filter out "deleted" allowances + * As there's no way to remove an Allowance with the current code, it's "deleted" by setting its `amount` to 0 + * along with `resetTimeMin` to 0 as well + * @param {SpendingLimitRow} allowance + * @returns boolean + */ +const discardZeroAllowance = ({ amount, resetTimeMin }: SpendingLimitRow): boolean => + !(amount === '0' && resetTimeMin === '0') + +export const requestAllowancesByDelegatesAndTokens = async ( + safeAddress: string, + tokensByDelegate: [string, string[]][], +): Promise => { + const batch = new web3ReadOnly.BatchRequest() + + const whenRequestValues = [] + + for (const [delegate, tokens] of tokensByDelegate) { + for (const token of tokens) { + whenRequestValues.push( + generateBatchRequests({ + abi: SpendingLimitModule.abi, + 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 + .map(([{ delegate, token }, [amount, spent, resetTimeMin, lastResetMin, nonce]]) => ({ + delegate, + token, + amount, + spent, + resetTimeMin, + lastResetMin, + nonce, + })) + .filter(discardZeroAllowance), + ) +} diff --git a/src/routes/safe/components/Settings/index.tsx b/src/routes/safe/components/Settings/index.tsx index fe08fef8dd..1046f90a32 100644 --- a/src/routes/safe/components/Settings/index.tsx +++ b/src/routes/safe/components/Settings/index.tsx @@ -7,7 +7,7 @@ import { useState } from 'react' import { useSelector } from 'react-redux' import Advanced from './Advanced' -import SpendingLimit from './SpendingLimit' +import SpendingLimitSettings from './SpendingLimit' import ManageOwners from './ManageOwners' import { RemoveSafeModal } from './RemoveSafeModal' import SafeDetails from './SafeDetails' @@ -122,7 +122,7 @@ const Settings: React.FC = () => { @@ -145,7 +145,7 @@ const Settings: React.FC = () => { {menuOptionIndex === 1 && } {menuOptionIndex === 2 && } {menuOptionIndex === 3 && } - {menuOptionIndex === 4 && } + {menuOptionIndex === 4 && } {menuOptionIndex === 5 && } diff --git a/src/utils/constants.ts b/src/utils/constants.ts index a21a6b6c9d..cb84da136b 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -14,3 +14,5 @@ export const OPENSEA_API_KEY = process.env.REACT_APP_OPENSEA_API_KEY || '' export const COLLECTIBLES_SOURCE = process.env.REACT_APP_COLLECTIBLES_SOURCE || 'OpenSea' export const TIMEOUT = process.env.NODE_ENV === 'test' ? 1500 : 5000 export const ETHERSCAN_API_KEY = process.env.REACT_APP_ETHERSCAN_API_KEY +export const SPENDING_LIMIT_MODULE_ADDRESS = + process.env.REACT_APP_SPENDING_LIMIT_MODULE_ADDRESS || '0x9e9Bf12b5a66c0f0A7435835e0365477E121B110'