@sonicswap/periphery
Version:
🎚 Peripheral smart contracts for interacting with the Sonicswap exchanges
899 lines (898 loc) • 548 kB
JSON
{
"contractName": "DeflatingERC20",
"abi": [
{
"inputs": [
{
"internalType": "uint256",
"name": "_totalSupply",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "Approval",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "from",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "to",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "Transfer",
"type": "event"
},
{
"inputs": [],
"name": "DOMAIN_SEPARATOR",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "PERMIT_TYPEHASH",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
},
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "allowance",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "balanceOf",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "decimals",
"outputs": [
{
"internalType": "uint8",
"name": "",
"type": "uint8"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "name",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "nonces",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "symbol",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "totalSupply",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "approve",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "transfer",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "from",
"type": "address"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "transferFrom",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"internalType": "uint256",
"name": "value",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "deadline",
"type": "uint256"
},
{
"internalType": "uint8",
"name": "v",
"type": "uint8"
},
{
"internalType": "bytes32",
"name": "r",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "s",
"type": "bytes32"
}
],
"name": "permit",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
],
"metadata": "{\"compiler\":{\"version\":\"0.6.12+commit.27d51765\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_totalSupply\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DOMAIN_SEPARATOR\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"PERMIT_TYPEHASH\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"nonces\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"permit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"/var/www/Sonic/sonicswap-periphery/contracts/test/DeflatingERC20.sol\":\"DeflatingERC20\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"/var/www/Sonic/sonicswap-periphery/contracts/libraries/SafeMath.sol\":{\"keccak256\":\"0x97845129a51dbb1869a765595d1c671fa473b97ef800756402afaadc7640a94e\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://5928803fe14654103d3f15b57b5b8df40b98f58cbe4e7044888f092f2462af04\",\"dweb:/ipfs/QmdnB83EBtNjwoKFHizxsTo6e2ytKN97SCvYnX28p75DCu\"]},\"/var/www/Sonic/sonicswap-periphery/contracts/test/DeflatingERC20.sol\":{\"keccak256\":\"0xe07dcdd716f1631bd5c86b46c1e906453c9700f0149ccb1a6f54ed75f3905f63\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://b254ec08f93f27b7e9c375262ab80be4fd71e43273b6615433e6c5f12e2fe5c8\",\"dweb:/ipfs/QmZyGYquz1Sde6EKhTd2U46miFjTqcXHhydJ287djiuRui\"]}},\"version\":1}",
"bytecode": "0x608060405234801561001057600080fd5b50604051610b49380380610b498339818101604052602081101561003357600080fd5b5051604080518082018252601481527f4465666c6174696e67205465737420546f6b656e0000000000000000000000006020918201528151808301835260018152603160f81b9082015281517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f818301527ff89e31130e6fd3d87d62a1ac2770fba58bed5a06c47ce70fa97f8218b1b2743a818401527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6606082015246608082018190523060a0808401919091528451808403909101815260c09092019093528051910120600355610125338361012c565b505061022c565b610145816000546101ce60201b6106781790919060201c565b60009081556001600160a01b0383168152600160209081526040909120546101769183906106786101ce821b17901c565b6001600160a01b03831660008181526001602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b80820182811015610226576040805162461bcd60e51b815260206004820152601460248201527f64732d6d6174682d6164642d6f766572666c6f77000000000000000000000000604482015290519081900360640190fd5b92915050565b61090e8061023b6000396000f3fe608060405234801561001057600080fd5b50600436106100cf5760003560e01c80633644e5151161008c57806395d89b411161006657806395d89b411461025b578063a9059cbb14610263578063d505accf1461028f578063dd62ed3e146102e2576100cf565b80633644e5151461020757806370a082311461020f5780637ecebe0014610235576100cf565b806306fdde03146100d4578063095ea7b31461015157806318160ddd1461019157806323b872dd146101ab57806330adf81f146101e1578063313ce567146101e9575b600080fd5b6100dc610310565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101165781810151838201526020016100fe565b50505050905090810190601f1680156101435780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561016757600080fd5b506001600160a01b038135169060200135610340565b604080519115158252519081900360200190f35b610199610357565b60408051918252519081900360200190f35b61017d600480360360608110156101c157600080fd5b506001600160a01b0381358116916020810135909116906040013561035d565b6101996103f1565b6101f1610415565b6040805160ff9092168252519081900360200190f35b61019961041a565b6101996004803603602081101561022557600080fd5b50356001600160a01b0316610420565b6101996004803603602081101561024b57600080fd5b50356001600160a01b0316610432565b6100dc610444565b61017d6004803603604081101561027957600080fd5b506001600160a01b038135169060200135610463565b6102e0600480360360e08110156102a557600080fd5b506001600160a01b03813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c00135610470565b005b610199600480360360408110156102f857600080fd5b506001600160a01b038135811691602001351661065b565b604051806040016040528060148152602001732232b33630ba34b733902a32b9ba102a37b5b2b760611b81525081565b600061034d3384846106c7565b5060015b92915050565b60005481565b6001600160a01b0383166000908152600260209081526040808320338452909152812054600019146103dc576001600160a01b03841660009081526002602090815260408083203384529091529020546103b79083610729565b6001600160a01b03851660009081526002602090815260408083203384529091529020555b6103e7848484610779565b5060019392505050565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b601281565b60035481565b60016020526000908152604090205481565b60046020526000908152604090205481565b6040518060400160405280600381526020016211151560ea1b81525081565b600061034d338484610779565b428410156104af576040805162461bcd60e51b81526020600482015260076024820152661156141254915160ca1b604482015290519081900360640190fd5b6003546001600160a01b0380891660008181526004602090815260408083208054600180820190925582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98186015280840196909652958d166060860152608085018c905260a085019590955260c08085018b90528151808603909101815260e08501825280519083012061190160f01b6101008601526101028501969096526101228085019690965280518085039096018652610142840180825286519683019690962095839052610162840180825286905260ff89166101828501526101a284018890526101c28401879052519193926101e280820193601f1981019281900390910190855afa1580156105ca573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116158015906106005750886001600160a01b0316816001600160a01b0316145b610645576040805162461bcd60e51b8152602060048201526011602482015270494e56414c49445f5349474e415455524560781b604482015290519081900360640190fd5b6106508989896106c7565b505050505050505050565b600260209081526000928352604080842090915290825290205481565b80820182811015610351576040805162461bcd60e51b815260206004820152601460248201527364732d6d6174682d6164642d6f766572666c6f7760601b604482015290519081900360640190fd5b6001600160a01b03808416600081815260026020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b80820382811115610351576040805162461bcd60e51b815260206004820152601560248201527464732d6d6174682d7375622d756e646572666c6f7760581b604482015290519081900360640190fd5b606481046107878482610846565b60006107938383610729565b6001600160a01b0386166000908152600160205260409020549091506107b99082610729565b6001600160a01b0380871660009081526001602052604080822093909355908616815220546107e89082610678565b6001600160a01b0380861660008181526001602090815260409182902094909455805185815290519193928916927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a35050505050565b6001600160a01b0382166000908152600160205260409020546108699082610729565b6001600160a01b038316600090815260016020526040812091909155546108909082610729565b60009081556040805183815290516001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef919081900360200190a3505056fea264697066735822122073981e09948109019dea012d71e40d55c20e7bbcadda7470d15caff92fe0f1a764736f6c634300060c0033",
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c80633644e5151161008c57806395d89b411161006657806395d89b411461025b578063a9059cbb14610263578063d505accf1461028f578063dd62ed3e146102e2576100cf565b80633644e5151461020757806370a082311461020f5780637ecebe0014610235576100cf565b806306fdde03146100d4578063095ea7b31461015157806318160ddd1461019157806323b872dd146101ab57806330adf81f146101e1578063313ce567146101e9575b600080fd5b6100dc610310565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101165781810151838201526020016100fe565b50505050905090810190601f1680156101435780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561016757600080fd5b506001600160a01b038135169060200135610340565b604080519115158252519081900360200190f35b610199610357565b60408051918252519081900360200190f35b61017d600480360360608110156101c157600080fd5b506001600160a01b0381358116916020810135909116906040013561035d565b6101996103f1565b6101f1610415565b6040805160ff9092168252519081900360200190f35b61019961041a565b6101996004803603602081101561022557600080fd5b50356001600160a01b0316610420565b6101996004803603602081101561024b57600080fd5b50356001600160a01b0316610432565b6100dc610444565b61017d6004803603604081101561027957600080fd5b506001600160a01b038135169060200135610463565b6102e0600480360360e08110156102a557600080fd5b506001600160a01b03813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c00135610470565b005b610199600480360360408110156102f857600080fd5b506001600160a01b038135811691602001351661065b565b604051806040016040528060148152602001732232b33630ba34b733902a32b9ba102a37b5b2b760611b81525081565b600061034d3384846106c7565b5060015b92915050565b60005481565b6001600160a01b0383166000908152600260209081526040808320338452909152812054600019146103dc576001600160a01b03841660009081526002602090815260408083203384529091529020546103b79083610729565b6001600160a01b03851660009081526002602090815260408083203384529091529020555b6103e7848484610779565b5060019392505050565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b601281565b60035481565b60016020526000908152604090205481565b60046020526000908152604090205481565b6040518060400160405280600381526020016211151560ea1b81525081565b600061034d338484610779565b428410156104af576040805162461bcd60e51b81526020600482015260076024820152661156141254915160ca1b604482015290519081900360640190fd5b6003546001600160a01b0380891660008181526004602090815260408083208054600180820190925582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98186015280840196909652958d166060860152608085018c905260a085019590955260c08085018b90528151808603909101815260e08501825280519083012061190160f01b6101008601526101028501969096526101228085019690965280518085039096018652610142840180825286519683019690962095839052610162840180825286905260ff89166101828501526101a284018890526101c28401879052519193926101e280820193601f1981019281900390910190855afa1580156105ca573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116158015906106005750886001600160a01b0316816001600160a01b0316145b610645576040805162461bcd60e51b8152602060048201526011602482015270494e56414c49445f5349474e415455524560781b604482015290519081900360640190fd5b6106508989896106c7565b505050505050505050565b600260209081526000928352604080842090915290825290205481565b80820182811015610351576040805162461bcd60e51b815260206004820152601460248201527364732d6d6174682d6164642d6f766572666c6f7760601b604482015290519081900360640190fd5b6001600160a01b03808416600081815260026020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b80820382811115610351576040805162461bcd60e51b815260206004820152601560248201527464732d6d6174682d7375622d756e646572666c6f7760581b604482015290519081900360640190fd5b606481046107878482610846565b60006107938383610729565b6001600160a01b0386166000908152600160205260409020549091506107b99082610729565b6001600160a01b0380871660009081526001602052604080822093909355908616815220546107e89082610678565b6001600160a01b0380861660008181526001602090815260409182902094909455805185815290519193928916927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a35050505050565b6001600160a01b0382166000908152600160205260409020546108699082610729565b6001600160a01b038316600090815260016020526040812091909155546108909082610729565b60009081556040805183815290516001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef919081900360200190a3505056fea264697066735822122073981e09948109019dea012d71e40d55c20e7bbcadda7470d15caff92fe0f1a764736f6c634300060c0033",
"immutableReferences": {},
"sourceMap": "99:3507:19:-:0;;;901:504;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;901:504:19;1232:4;;;;;;;;;;;;901:504;1232:4;;;;1266:10;;;;;;;;;;-1:-1:-1;;;1266:10:19;;;;1075:272;;1103:95;1075:272;;;;1216:22;1075:272;;;;1256:21;1075:272;;;;1005:9;1075:272;;;;;;1328:4;1075:272;;;;;;;;;;;;;;;;;;;;;;;;;1052:305;;;;;1033:16;:324;1367:31;1373:10;901:504;1367:5;:31::i;:::-;901:504;;99:3507;;1411:197;1483:22;1499:5;1483:11;;:15;;;;;;:22;;;;:::i;:::-;1469:11;:36;;;-1:-1:-1;;;;;1531:13:19;;;;:9;:13;;;;;;;;;:24;;1549:5;;1531:17;;;;;:24;;:::i;:::-;-1:-1:-1;;;;;1515:13:19;;;;;;:9;:13;;;;;;;;:40;;;;1570:31;;;;;;;1515:13;;;;1570:31;;;;;;;;;;1411:197;;:::o;191:126:15:-;274:5;;;269:16;;;;261:49;;;;;-1:-1:-1;;;261:49:15;;;;;;;;;;;;;;;;;;;;;;;;;;;;191:126;;;;:::o;99:3507:19:-;;;;;;;",
"deployedSourceMap": "99:3507:19:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;159:52;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2371:144;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;2371:144:19;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;301:24;;;:::i;:::-;;;;;;;;;;;;;;;;2663:295;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;2663:295:19;;;;;;;;;;;;;;;;;:::i;587:108::-;;;:::i;260:35::-;;;:::i;:::-;;;;;;;;;;;;;;;;;;;446:31;;;:::i;331:41::-;;;;;;;;;;;;;;;;-1:-1:-1;331:41:19;-1:-1:-1;;;;;331:41:19;;:::i;701:38::-;;;;;;;;;;;;;;;;-1:-1:-1;701:38:19;-1:-1:-1;;;;;701:38:19;;:::i;217:37::-;;;:::i;2521:136::-;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;2521:136:19;;;;;;;;:::i;2964:640::-;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;2964:640:19;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;378:61;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;378:61:19;;;;;;;;;;:::i;159:52::-;;;;;;;;;;;;;;-1:-1:-1;;;159:52:19;;;;:::o;2371:144::-;2435:4;2451:36;2460:10;2472:7;2481:5;2451:8;:36::i;:::-;-1:-1:-1;2504:4:19;2371:144;;;;;:::o;301:24::-;;;;:::o;2663:295::-;-1:-1:-1;;;;;2761:15:19;;2741:4;2761:15;;;:9;:15;;;;;;;;2777:10;2761:27;;;;;;;;-1:-1:-1;;2761:39:19;2757:138;;-1:-1:-1;;;;;2846:15:19;;;;;;:9;:15;;;;;;;;2862:10;2846:27;;;;;;;;:38;;2878:5;2846:31;:38::i;:::-;-1:-1:-1;;;;;2816:15:19;;;;;;:9;:15;;;;;;;;2832:10;2816:27;;;;;;;:68;2757:138;2904:26;2914:4;2920:2;2924:5;2904:9;:26::i;:::-;-1:-1:-1;2947:4:19;2663:295;;;;;:::o;587:108::-;629:66;587:108;:::o;260:35::-;293:2;260:35;:::o;446:31::-;;;;:::o;331:41::-;;;;;;;;;;;;;:::o;701:38::-;;;;;;;;;;;;;:::o;217:37::-;;;;;;;;;;;;;;-1:-1:-1;;;217:37:19;;;;:::o;2521:136::-;2581:4;2597:32;2607:10;2619:2;2623:5;2597:9;:32::i;2964:640::-;3109:15;3097:8;:27;;3089:47;;;;;-1:-1:-1;;;3089:47:19;;;;;;;;;;;;-1:-1:-1;;;3089:47:19;;;;;;;;;;;;;;;3248:16;;-1:-1:-1;;;;;3343:13:19;;;3146:14;3343:13;;;:6;:13;;;;;;;;:15;;;;;;;;;3292:77;;629:66;3292:77;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3282:88;;;;;;-1:-1:-1;;;3186:198:19;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3163:231;;;;;;;;;3431:26;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3146:14;;3343:15;3431:26;;;;;-1:-1:-1;;3431:26:19;;;;;;;;;;3343:15;3431:26;;;;;;;;;;;;;;;-1:-1:-1;;3431:26:19;;-1:-1:-1;;3431:26:19;;;-1:-1:-1;;;;;;;3475:30:19;;;;;;:59;;;3529:5;-1:-1:-1;;;;;3509:25:19;:16;-1:-1:-1;;;;;3509:25:19;;3475:59;3467:89;;;;;-1:-1:-1;;;3467:89:19;;;;;;;;;;;;-1:-1:-1;;;3467:89:19;;;;;;;;;;;;;;;3566:31;3575:5;3582:7;3591:5;3566:8;:31::i;:::-;2964:640;;;;;;;;;:::o;378:61::-;;;;;;;;;;;;;;;;;;;;;;;;:::o;191:126:15:-;274:5;;;269:16;;;;261:49;;;;;-1:-1:-1;;;261:49:15;;;;;;;;;;;;-1:-1:-1;;;261:49:15;;;;;;;;;;;;;;1825:166:19;-1:-1:-1;;;;;1905:16:19;;;;;;;:9;:16;;;;;;;;:25;;;;;;;;;;;;;:33;;;1953:31;;;;;;;;;;;;;;;;;1825:166;;;:::o;323:127:15:-;406:5;;;401:16;;;;393:50;;;;;-1:-1:-1;;;393:50:15;;;;;;;;;;;;-1:-1:-1;;;393:50:15;;;;;;;;;;;;;;1997:368:19;2098:3;2090:11;;2111:23;2117:4;2090:11;2111:5;:23::i;:::-;2144:19;2166:21;:5;2176:10;2166:9;:21::i;:::-;-1:-1:-1;;;;;2215:15:19;;;;;;:9;:15;;;;;;2144:43;;-1:-1:-1;2215:35:19;;2144:43;2215:19;:35::i;:::-;-1:-1:-1;;;;;2197:15:19;;;;;;;:9;:15;;;;;;:53;;;;2276:13;;;;;;;:33;;2294:14;2276:17;:33::i;:::-;-1:-1:-1;;;;;2260:13:19;;;;;;;:9;:13;;;;;;;;;:49;;;;2324:34;;;;;;;2260:13;;2324:34;;;;;;;;;;;;;1997:368;;;;;:::o;1614:205::-;-1:-1:-1;;;;;1692:15:19;;;;;;:9;:15;;;;;;:26;;1712:5;1692:19;:26::i;:::-;-1:-1:-1;;;;;1674:15:19;;;;;;:9;:15;;;;;:44;;;;1742:11;:22;;1758:5;1742:15;:22::i;:::-;1728:11;:36;;;1779:33;;;;;;;;-1:-1:-1;;;;;1779:33:19;;;;;;;;;;;;;1614:205;;:::o",
"source": "// SPDX-License-Identifier: GPL-3.0\npragma solidity =0.6.12;\n\nimport '../libraries/SafeMath.sol';\n\ncontract DeflatingERC20 {\n using SafeMath for uint;\n\n string public constant name = 'Deflating Test Token';\n string public constant symbol = 'DTT';\n uint8 public constant decimals = 18;\n uint public totalSupply;\n mapping(address => uint) public balanceOf;\n mapping(address => mapping(address => uint)) public allowance;\n\n bytes32 public DOMAIN_SEPARATOR;\n // keccak256(\"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\");\n bytes32 public constant PERMIT_TYPEHASH = 0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9;\n mapping(address => uint) public nonces;\n\n event Approval(address indexed owner, address indexed spender, uint value);\n event Transfer(address indexed from, address indexed to, uint value);\n\n constructor(uint _totalSupply) public {\n uint chainId;\n assembly {\n chainId := chainid()\n }\n DOMAIN_SEPARATOR = keccak256(\n abi.encode(\n keccak256('EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)'),\n keccak256(bytes(name)),\n keccak256(bytes('1')),\n chainId,\n address(this)\n )\n );\n _mint(msg.sender, _totalSupply);\n }\n\n function _mint(address to, uint value) internal {\n totalSupply = totalSupply.add(value);\n balanceOf[to] = balanceOf[to].add(value);\n emit Transfer(address(0), to, value);\n }\n\n function _burn(address from, uint value) internal {\n balanceOf[from] = balanceOf[from].sub(value);\n totalSupply = totalSupply.sub(value);\n emit Transfer(from, address(0), value);\n }\n\n function _approve(address owner, address spender, uint value) private {\n allowance[owner][spender] = value;\n emit Approval(owner, spender, value);\n }\n\n function _transfer(address from, address to, uint value) private {\n uint burnAmount = value / 100;\n _burn(from, burnAmount);\n uint transferAmount = value.sub(burnAmount);\n balanceOf[from] = balanceOf[from].sub(transferAmount);\n balanceOf[to] = balanceOf[to].add(transferAmount);\n emit Transfer(from, to, transferAmount);\n }\n\n function approve(address spender, uint value) external returns (bool) {\n _approve(msg.sender, spender, value);\n return true;\n }\n\n function transfer(address to, uint value) external returns (bool) {\n _transfer(msg.sender, to, value);\n return true;\n }\n\n function transferFrom(address from, address to, uint value) external returns (bool) {\n if (allowance[from][msg.sender] != uint(-1)) {\n allowance[from][msg.sender] = allowance[from][msg.sender].sub(value);\n }\n _transfer(from, to, value);\n return true;\n }\n\n function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external {\n require(deadline >= block.timestamp, 'EXPIRED');\n bytes32 digest = keccak256(\n abi.encodePacked(\n '\\x19\\x01',\n DOMAIN_SEPARATOR,\n keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, value, nonces[owner]++, deadline))\n )\n );\n address recoveredAddress = ecrecover(digest, v, r, s);\n require(recoveredAddress != address(0) && recoveredAddress == owner, 'INVALID_SIGNATURE');\n _approve(owner, spender, value);\n }\n}\n",
"sourcePath": "/var/www/Sonic/sonicswap-periphery/contracts/test/DeflatingERC20.sol",
"ast": {
"absolutePath": "/var/www/Sonic/sonicswap-periphery/contracts/test/DeflatingERC20.sol",
"exportedSymbols": {
"DeflatingERC20": [
7068
]
},
"id": 7069,
"license": "GPL-3.0",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 6655,
"literals": [
"solidity",
"=",
"0.6",
".12"
],
"nodeType": "PragmaDirective",
"src": "36:24:19"
},
{
"absolutePath": "/var/www/Sonic/sonicswap-periphery/contracts/libraries/SafeMath.sol",
"file": "../libraries/SafeMath.sol",
"id": 6656,
"nodeType": "ImportDirective",
"scope": 7069,
"sourceUnit": 5609,
"src": "62:35:19",
"symbolAliases": [],
"unitAlias": ""
},
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": true,
"id": 7068,
"linearizedBaseContracts": [
7068
],
"name": "DeflatingERC20",
"nodeType": "ContractDefinition",
"nodes": [
{
"id": 6659,
"libraryName": {
"contractScope": null,
"id": 6657,
"name": "SafeMath",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 5608,
"src": "135:8:19",
"typeDescriptions": {
"typeIdentifier": "t_contract$_SafeMath_$5608",
"typeString": "library SafeMath"
}
},
"nodeType": "UsingForDirective",
"src": "129:24:19",
"typeName": {
"id": 6658,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "148:4:19",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
},
{
"constant": true,
"functionSelector": "06fdde03",
"id": 6662,
"mutability": "constant",
"name": "name",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 7068,
"src": "159:52:19",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string"
},
"typeName": {
"id": 6660,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "159:6:19",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
}
},
"value": {
"argumentTypes": null,
"hexValue": "4465666c6174696e67205465737420546f6b656e",
"id": 6661,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "189:22:19",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_f89e31130e6fd3d87d62a1ac2770fba58bed5a06c47ce70fa97f8218b1b2743a",
"typeString": "literal_string \"Deflating Test Token\""
},
"value": "Deflating Test Token"
},
"visibility": "public"
},
{
"constant": true,
"functionSelector": "95d89b41",
"id": 6665,
"mutability": "constant",
"name": "symbol",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 7068,
"src": "217:37:19",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string"
},
"typeName": {
"id": 6663,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "217:6:19",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
}
},
"value": {
"argumentTypes": null,
"hexValue": "445454",
"id": 6664,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "249:5:19",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_0862d7701ae2a04548299440d8e9bcde598aaa04f40d2b263697efe0cc6c0bb4",
"typeString": "literal_string \"DTT\""
},
"value": "DTT"
},
"visibility": "public"
},
{
"constant": true,
"functionSelector": "313ce567",
"id": 6668,
"mutability": "constant",
"name": "decimals",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 7068,
"src": "260:35:19",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
},
"typeName": {
"id": 6666,
"name": "uint8",
"nodeType": "ElementaryTypeName",
"src": "260:5:19",
"typeDescriptions": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
}
},
"value": {
"argumentTypes": null,
"hexValue": "3138",
"id": 6667,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "293:2:19",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_18_by_1",
"typeString": "int_const 18"
},
"value": "18"
},
"visibility": "public"
},
{
"constant": false,
"functionSelector": "18160ddd",
"id": 6670,
"mutability": "mutable",
"name": "totalSupply",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 7068,
"src": "301:24:19",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 6669,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "301:4:19",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"functionSelector": "70a08231",
"id": 6674,
"mutability": "mutable",
"name": "balanceOf",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 7068,
"src": "331:41:19",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_uint256_$",
"typeString": "mapping(address => uint256)"
},
"typeName": {
"id": 6673,
"keyType": {
"id": 6671,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "339:7:19",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Mapping",
"src": "331:24:19",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_uint256_$",
"typeString": "mapping(address => uint256)"
},
"valueType": {
"id": 6672,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "350:4:19",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"functionSelector": "dd62ed3e",
"id": 6680,
"mutability": "mutable",
"name": "allowance",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 7068,
"src": "378:61:19",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_uint256_$_$",
"typeString": "mapping(address => mapping(address => uint256))"
},
"typeName": {
"id": 6679,
"keyType": {
"id": 6675,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "386:7:19",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Mapping",
"src": "378:44:19",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_uint256_$_$",
"typeString": "mapping(address => mapping(address => uint256))"
},
"valueType": {
"id": 6678,
"keyType": {
"id": 6676,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "405:7:19",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Mapping",
"src": "397:24:19",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_uint256_$",
"typeString": "mapping(address => uint256)"
},
"valueType": {
"id": 6677,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "416:4:19",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"functionSelector": "3644e515",
"id": 6682,
"mutability": "mutable",
"name": "DOMAIN_SEPARATOR",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 7068,
"src": "446:31:19",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 6681,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "446:7:19",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"value": null,
"visibility": "public"
},
{
"constant": true,
"functionSelector": "30adf81f",
"id": 6685,
"mutability": "constant",
"name": "PERMIT_TYPEHASH",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 7068,
"src": "587:108:19",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 6683,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "587:7:19",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"value": {
"argumentTypes": null,
"hexValue": "307836653731656461653132623162393766346431663630333730666566313031303566613266616165303132363131346131363963363438343564363132366339",
"id": 6684,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "629:66:19",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_49955707469362902507454157297736832118868343942642399513960811609542965143241_by_1",
"typeString": "int_const 4995...(69 digits omitted)...3241"
},
"value": "0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9"
},
"visibility": "public"
},
{
"constant": false,
"functionSelector": "7ecebe00",
"id": 6689,
"mutability": "mutable",
"name": "nonces",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 7068,
"src": "701:38:19",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_uint256_$",
"typeString": "mapping(address => uint256)"
},
"typeName": {
"id": 6688,
"keyType": {
"id": 6686,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "709:7:19",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Mapping",
"src": "701:24:19",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_uint256_$",
"typeString": "mapping(address => uint256)"
},
"valueType": {
"id": 6687,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "720:4:19",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
},
"value": null,
"visibility": "public"
},
{
"anonymous": false,
"documentation": null,
"id": 6697,
"name": "Approval",
"nodeType": "EventDefinition",
"parameters": {
"id": 6696,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 6691,
"indexed": true,
"mutability": "mutable",
"name": "owner",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 6697,
"src": "761:21:19",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 6690,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "761:7:19",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 6693,
"indexed": true,
"mutability": "mutable",
"name": "spender",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 6697,
"src": "784:23:19",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 6692,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "784:7:19",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 6695,
"indexed": false,
"mutability": "mutable",
"name": "value",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 6697,
"src": "809:10:19",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},