UNPKG

@gooddollar/goodcontracts

Version:
1,148 lines 93.7 kB
{ "contractName": "AbstractFees", "abi": [ { "inputs": [], "payable": false, "stateMutability": "nonpayable", "type": "constructor" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" } ], "name": "OwnershipTransferred", "type": "event" }, { "constant": true, "inputs": [], "name": "isOwner", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "isRegistered", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "internalType": "address", "name": "scheme", "type": "address" } ], "name": "isRegistered", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "owner", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [], "name": "renounceOwnership", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "internalType": "contract Avatar", "name": "_avatar", "type": "address" } ], "name": "setAvatar", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "internalType": "address", "name": "newOwner", "type": "address" } ], "name": "transferOwnership", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [ { "internalType": "uint256", "name": "_value", "type": "uint256" }, { "internalType": "address", "name": "_sender", "type": "address" }, { "internalType": "address", "name": "_recipient", "type": "address" } ], "name": "getTxFees", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" }, { "internalType": "bool", "name": "", "type": "bool" } ], "payable": false, "stateMutability": "view", "type": "function" } ], "metadata": "{\"compiler\":{\"version\":\"0.5.16+commit.9c3226ce\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_value\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_recipient\",\"type\":\"address\"}],\"name\":\"getTxFees\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"isOwner\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"isRegistered\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"scheme\",\"type\":\"address\"}],\"name\":\"isRegistered\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"contract Avatar\",\"name\":\"_avatar\",\"type\":\"address\"}],\"name\":\"setAvatar\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"methods\":{\"isOwner()\":{\"return\":\"true if `msg.sender` is the owner of the contract.\"},\"isRegistered()\":{\"details\":\"function to see if an avatar has been set and if this scheme is registered\",\"return\":\"true if scheme is registered\"},\"isRegistered(address)\":{\"details\":\"function to see if an avatar has been set and if this scheme is registered\",\"return\":\"true if scheme is registered\"},\"owner()\":{\"return\":\"the address of the owner.\"},\"renounceOwnership()\":{\"details\":\"Allows the current owner to relinquish control of the contract.\"},\"setAvatar(address)\":{\"details\":\"Function to set a new avatar and controller for scheme can only be done by owner of scheme\"},\"transferOwnership(address)\":{\"details\":\"Allows the current owner to transfer control of the contract to a newOwner.\",\"params\":{\"newOwner\":\"The address to transfer ownership to.\"}}},\"title\":\"Fee formula abstract contract\"},\"userdoc\":{\"methods\":{\"renounceOwnership()\":{\"notice\":\"Renouncing to ownership will leave the contract without an owner. It will not be possible to call the functions with the `onlyOwner` modifier anymore.\"}}}},\"settings\":{\"compilationTarget\":{\"/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/contracts/dao/schemes/FeeFormula.sol\":\"AbstractFees\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/contracts/dao/schemes/FeeFormula.sol\":{\"keccak256\":\"0x2ac93f891a65aa60b93e2b27552850dfa459b88f5a19edc29bb5bab0cc4f3eaa\",\"urls\":[\"bzz-raw://bddb94bc0230d959d2362887a253a47b91f0de6804cba8e4569a7cac47c39b5a\",\"dweb:/ipfs/QmTdkPQHRdzxJ7D7pi9cowLgYY9wVja416dhBwCsdtPEv5\"]},\"/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/contracts/dao/schemes/SchemeGuard.sol\":{\"keccak256\":\"0x32e1b2a172e2c22a6aa757bfcb0722cc67f64c5c2e48df3dec2737903516d565\",\"urls\":[\"bzz-raw://bee57a8eba08348e93a0c18f3ab534e67865c0fa27afe27f5cf234bd5f248915\",\"dweb:/ipfs/Qmd8aveHWcUkYWMyJrJRZPyVXj8MAMBfpBFo6g4Z2VJeo3\"]},\"@daostack/arc/contracts/controller/Avatar.sol\":{\"keccak256\":\"0x4e4fb9d3bc21f42fbfc6a01e9f8aa483a59e9f447b0d604f55b587a81ec09ef4\",\"urls\":[\"bzz-raw://9d3c1c7575cf6075ea1d89921f09b9b8e322b208dacaf0446cd4f64506c999f0\",\"dweb:/ipfs/QmVGDDHAR2ByuQpbgV7BBKXGEAcbaWvejpEZYzHgaagBFK\"]},\"@daostack/arc/contracts/controller/ControllerInterface.sol\":{\"keccak256\":\"0x933e92612c90f292c7b59908958b003f1a13d90b97bed0572b566353c20974dc\",\"urls\":[\"bzz-raw://ce1fcf85b744fcce2dbd4205e3943e9b4ec36a5f0330d4bbf61e65f1a3e0e470\",\"dweb:/ipfs/QmUWiLkBDdekhpy93nTzBtxDHL6yNh6sTUM9G8VbsHcBzy\"]},\"@daostack/arc/contracts/controller/DAOToken.sol\":{\"keccak256\":\"0x9b213e4e3ceeffcfc1c962a43b70b8d763d8091a2dd713fc1989b97bb68786e6\",\"urls\":[\"bzz-raw://51d1d6e85fd90f45395a16b7a3c703c4636e836041f2a13f806e4222ef2e59c1\",\"dweb:/ipfs/QmQjeCeFf7TJzsYjT5scyZUDDixBA8Yy8YppgBuxcKPDnP\"]},\"@daostack/arc/contracts/globalConstraints/GlobalConstraintInterface.sol\":{\"keccak256\":\"0xc006c4591ec10b845a56e13f6791db2c428610953034686d52b2a934b6c8f36f\",\"urls\":[\"bzz-raw://19495cd88280e54d7ddcd043ffeff75e6d3777a0c42debcd61cae448e9497ea0\",\"dweb:/ipfs/QmYxWz7CgFmmddrcVXJKfob5Ktwykc2imNVUwLSR5WR8bJ\"]},\"@daostack/arc/contracts/libs/SafeERC20.sol\":{\"keccak256\":\"0xf6727d432f67046145b078f40c1cc4f6be7b0d12a6678ecaf457edf7550d244c\",\"urls\":[\"bzz-raw://5dba7734c4fed446c084a707761cbc66ba22b8b93ef53c8d4a22a76b6e271690\",\"dweb:/ipfs/QmP2VpPKUqLh4ZZs6LaxHVpCN1zCmiorygL9bMub4mbYCw\"]},\"@daostack/infra/contracts/Reputation.sol\":{\"keccak256\":\"0x3d226dac0fe7d758f0287fb28bc25fcec1f69d19888ae3a550fa49856d61c482\",\"urls\":[\"bzz-raw://8856852c8fe0ba1c9aab326f0a9a6e7f31a238de2778fa5188e6fc399f7eb352\",\"dweb:/ipfs/QmVH4ppR9Dk7v8yxaSgeArdMv9gBBVoQxEf4E3UsqQ4rY2\"]},\"openzeppelin-solidity/contracts/math/SafeMath.sol\":{\"keccak256\":\"0x965012d27b4262d7a41f5028cbb30c51ebd9ecd4be8fb30380aaa7a3c64fbc8b\",\"urls\":[\"bzz-raw://1eb493553b27efd46c231a836a83ce50d215639feb97b4aac9f301d0fd034ff5\",\"dweb:/ipfs/QmbMdvSXcqGKxeeYvzF3VrWpoHQyVzMXBhzhAokF2Gdymv\"]},\"openzeppelin-solidity/contracts/ownership/Ownable.sol\":{\"keccak256\":\"0x980de387a1a020a498f53d00f89fecebb12c949a17e8f160093c0303ede2b786\",\"urls\":[\"bzz-raw://f07a2c393caa85f62f0aaa461e3edd50aa59371d4209778ba0558d7f8b4b856c\",\"dweb:/ipfs/QmeN3ZiYGSjCnQFeYaJNgoXjF9eDue1g3e9pqManRkeBtV\"]},\"openzeppelin-solidity/contracts/token/ERC20/ERC20.sol\":{\"keccak256\":\"0xba431353cb4fe70777ac026231eb5468e41aa1e81240a2b8136917acc5fff4dc\",\"urls\":[\"bzz-raw://f40c91ca270bdc9b156f339081a0fc2bbcf73cf5f62b8c73ba555df753ff6619\",\"dweb:/ipfs/QmT8y2VVjGaFdGphpcXrgvdPi2EgF9LuCDgJiJ89LvpFRV\"]},\"openzeppelin-solidity/contracts/token/ERC20/ERC20Burnable.sol\":{\"keccak256\":\"0xa3e68fd7f987c8fbdaf4867d428a69a15f3cf2f69709a5b0a0fbef750b0e6fbc\",\"urls\":[\"bzz-raw://50b1ff986d3b2793850a66c8429d9886fdfb134b1509b3e98714e3e2a71e24f5\",\"dweb:/ipfs/QmSQBYPeY9tbR3ciGRNQqvcWKnNiuxtVMq2MsPWpLwuGGm\"]},\"openzeppelin-solidity/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0x079c4e23ee448f529e43bfa3c4e8fb4be52cd0318ee923a276835bedf45b93d8\",\"urls\":[\"bzz-raw://ee762ff5b7746e41d27dcbcea00c7a3034b58adb1b45ddadddb5b721aff450df\",\"dweb:/ipfs/QmdxqtgEFZjHCoiYyz6pUAQ5iBm7As25jcyEbZoTaAgyDa\"]},\"openzeppelin-solidity/contracts/utils/Address.sol\":{\"keccak256\":\"0x5c731061b804fa256fc8c05150eafe5d20b6bb94541a8f187912bf84f7033f34\",\"urls\":[\"bzz-raw://a3c2d9f046beebab7fb41b1b124a6a124a36f510f7c67365861402ac831bdc71\",\"dweb:/ipfs/QmUtASRgitregbKH83anopLtF9vFQe3BKeAjhUa6F7t9YV\"]}},\"version\":1}", "bytecode": "0x", "deployedBytecode": "0x", "sourceMap": "", "deployedSourceMap": "", "source": "pragma solidity >0.5.4;\n\nimport \"openzeppelin-solidity/contracts/math/SafeMath.sol\";\nimport \"@daostack/arc/contracts/controller/Avatar.sol\";\n\nimport \"./SchemeGuard.sol\";\n\n/**\n * @title Fee formula abstract contract\n */\ncontract AbstractFees is SchemeGuard {\n constructor() public SchemeGuard(Avatar(0)) {}\n\n function getTxFees(\n uint256 _value,\n address _sender,\n address _recipient\n ) public view returns (uint256, bool);\n}\n\n/**\n * @title Fee formula contract\n * contract that provides a function to calculate\n * fees as a percentage of any given value\n */\ncontract FeeFormula is AbstractFees {\n using SafeMath for uint256;\n\n uint256 public percentage;\n bool public constant senderPays = false;\n\n /**\n * @dev Constructor. Requires the given percentage parameter\n * to be less than 100.\n * @param _percentage the percentage to calculate fees of\n */\n constructor(uint256 _percentage) public {\n require(_percentage < 100, \"Percentage should be <100\");\n percentage = _percentage;\n }\n\n /** @dev calculates the fee of given value.\n * @param _value the value of the transaction to calculate fees from\n * @param _sender address sending.\n * @param _recipient address receiving.\n * @return the transactional fee for given value\n */\n function getTxFees(\n uint256 _value,\n address _sender,\n address _recipient\n ) public view returns (uint256, bool) {\n return (_value.mul(percentage).div(100), senderPays);\n }\n}\n", "sourcePath": "/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/contracts/dao/schemes/FeeFormula.sol", "ast": { "absolutePath": "/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/contracts/dao/schemes/FeeFormula.sol", "exportedSymbols": { "AbstractFees": [ 1098 ], "FeeFormula": [ 1150 ] }, "id": 1151, "nodeType": "SourceUnit", "nodes": [ { "id": 1070, "literals": [ "solidity", ">", "0.5", ".4" ], "nodeType": "PragmaDirective", "src": "0:23:4" }, { "absolutePath": "openzeppelin-solidity/contracts/math/SafeMath.sol", "file": "openzeppelin-solidity/contracts/math/SafeMath.sol", "id": 1071, "nodeType": "ImportDirective", "scope": 1151, "sourceUnit": 21309, "src": "25:59:4", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "@daostack/arc/contracts/controller/Avatar.sol", "file": "@daostack/arc/contracts/controller/Avatar.sol", "id": 1072, "nodeType": "ImportDirective", "scope": 1151, "sourceUnit": 12706, "src": "85:55:4", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/contracts/dao/schemes/SchemeGuard.sol", "file": "./SchemeGuard.sol", "id": 1073, "nodeType": "ImportDirective", "scope": 1151, "sourceUnit": 1424, "src": "142:27:4", "symbolAliases": [], "unitAlias": "" }, { "baseContracts": [ { "arguments": null, "baseName": { "contractScope": null, "id": 1074, "name": "SchemeGuard", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 1423, "src": "244:11:4", "typeDescriptions": { "typeIdentifier": "t_contract$_SchemeGuard_$1423", "typeString": "contract SchemeGuard" } }, "id": 1075, "nodeType": "InheritanceSpecifier", "src": "244:11:4" } ], "contractDependencies": [ 1423, 21417 ], "contractKind": "contract", "documentation": "@title Fee formula abstract contract", "fullyImplemented": false, "id": 1098, "linearizedBaseContracts": [ 1098, 1423, 21417 ], "name": "AbstractFees", "nodeType": "ContractDefinition", "nodes": [ { "body": { "id": 1083, "nodeType": "Block", "src": "306:2:4", "statements": [] }, "documentation": null, "id": 1084, "implemented": true, "kind": "constructor", "modifiers": [ { "arguments": [ { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "hexValue": "30", "id": 1079, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "302:1:4", "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": 1078, "name": "Avatar", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 12705, "src": "295:6:4", "typeDescriptions": { "typeIdentifier": "t_type$_t_contract$_Avatar_$12705_$", "typeString": "type(contract Avatar)" } }, "id": 1080, "isConstant": false, "isLValue": false, "isPure": true, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "295:9:4", "typeDescriptions": { "typeIdentifier": "t_contract$_Avatar_$12705", "typeString": "contract Avatar" } } ], "id": 1081, "modifierName": { "argumentTypes": null, "id": 1077, "name": "SchemeGuard", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1423, "src": "283:11:4", "typeDescriptions": { "typeIdentifier": "t_type$_t_contract$_SchemeGuard_$1423_$", "typeString": "type(contract SchemeGuard)" } }, "nodeType": "ModifierInvocation", "src": "283:22:4" } ], "name": "", "nodeType": "FunctionDefinition", "parameters": { "id": 1076, "nodeType": "ParameterList", "parameters": [], "src": "273:2:4" }, "returnParameters": { "id": 1082, "nodeType": "ParameterList", "parameters": [], "src": "306:0:4" }, "scope": 1098, "src": "262:46:4", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" }, { "body": null, "documentation": null, "id": 1097, "implemented": false, "kind": "function", "modifiers": [], "name": "getTxFees", "nodeType": "FunctionDefinition", "parameters": { "id": 1091, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1086, "name": "_value", "nodeType": "VariableDeclaration", "scope": 1097, "src": "342:14:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1085, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "342:7:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 1088, "name": "_sender", "nodeType": "VariableDeclaration", "scope": 1097, "src": "366:15:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 1087, "name": "address", "nodeType": "ElementaryTypeName", "src": "366:7:4", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 1090, "name": "_recipient", "nodeType": "VariableDeclaration", "scope": 1097, "src": "391:18:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 1089, "name": "address", "nodeType": "ElementaryTypeName", "src": "391:7:4", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "332:83:4" }, "returnParameters": { "id": 1096, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1093, "name": "", "nodeType": "VariableDeclaration", "scope": 1097, "src": "437:7:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1092, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "437:7:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 1095, "name": "", "nodeType": "VariableDeclaration", "scope": 1097, "src": "446:4:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 1094, "name": "bool", "nodeType": "ElementaryTypeName", "src": "446:4:4", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "value": null, "visibility": "internal" } ], "src": "436:15:4" }, "scope": 1098, "src": "314:138:4", "stateMutability": "view", "superFunction": null, "visibility": "public" } ], "scope": 1151, "src": "219:235:4" }, { "baseContracts": [ { "arguments": null, "baseName": { "contractScope": null, "id": 1099, "name": "AbstractFees", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 1098, "src": "611:12:4", "typeDescriptions": { "typeIdentifier": "t_contract$_AbstractFees_$1098", "typeString": "contract AbstractFees" } }, "id": 1100, "nodeType": "InheritanceSpecifier", "src": "611:12:4" } ], "contractDependencies": [ 1098, 1423, 21417 ], "contractKind": "contract", "documentation": "@title Fee formula contract\ncontract that provides a function to calculate\nfees as a percentage of any given value", "fullyImplemented": true, "id": 1150, "linearizedBaseContracts": [ 1150, 1098, 1423, 21417 ], "name": "FeeFormula", "nodeType": "ContractDefinition", "nodes": [ { "id": 1103, "libraryName": { "contractScope": null, "id": 1101, "name": "SafeMath", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 21308, "src": "636:8:4", "typeDescriptions": { "typeIdentifier": "t_contract$_SafeMath_$21308", "typeString": "library SafeMath" } }, "nodeType": "UsingForDirective", "src": "630:27:4", "typeName": { "id": 1102, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "649:7:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } }, { "constant": false, "id": 1105, "name": "percentage", "nodeType": "VariableDeclaration", "scope": 1150, "src": "663:25:4", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1104, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "663:7:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "public" }, { "constant": true, "id": 1108, "name": "senderPays", "nodeType": "VariableDeclaration", "scope": 1150, "src": "694:39:4", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 1106, "name": "bool", "nodeType": "ElementaryTypeName", "src": "694:4:4", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "value": { "argumentTypes": null, "hexValue": "66616c7365", "id": 1107, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", "src": "728:5:4", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "value": "false" }, "visibility": "public" }, { "body": { "id": 1124, "nodeType": "Block", "src": "951:106:4", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1116, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 1114, "name": "_percentage", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1110, "src": "969:11:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "<", "rightExpression": { "argumentTypes": null, "hexValue": "313030", "id": 1115, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "983:3:4", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_100_by_1", "typeString": "int_const 100" }, "value": "100" }, "src": "969:17:4", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "argumentTypes": null, "hexValue": "50657263656e746167652073686f756c64206265203c313030", "id": 1117, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "988:27:4", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_d23d155ce1199578552f069509ef8a20a692a081b3518bb8d51a8f1a83643608", "typeString": "literal_string \"Percentage should be <100\"" }, "value": "Percentage should be <100" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_stringliteral_d23d155ce1199578552f069509ef8a20a692a081b3518bb8d51a8f1a83643608", "typeString": "literal_string \"Percentage should be <100\"" } ], "id": 1113, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 22174, 22175 ], "referencedDeclaration": 22175, "src": "961:7:4", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 1118, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "961:55:4", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 1119, "nodeType": "ExpressionStatement", "src": "961:55:4" }, { "expression": { "argumentTypes": null, "id": 1122, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 1120, "name": "percentage", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1105, "src": "1026:10:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "id": 1121, "name": "_percentage", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1110, "src": "1039:11:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "1026:24:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 1123, "nodeType": "ExpressionStatement", "src": "1026:24:4" } ] }, "documentation": "@dev Constructor. Requires the given percentage parameter\nto be less than 100.\n@param _percentage the percentage to calculate fees of", "id": 1125, "implemented": true, "kind": "constructor", "modifiers": [], "name": "", "nodeType": "FunctionDefinition", "parameters": { "id": 1111, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1110, "name": "_percentage", "nodeType": "VariableDeclaration", "scope": 1125, "src": "923:19:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1109, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "923:7:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "922:21:4" }, "returnParameters": { "id": 1112, "nodeType": "ParameterList", "parameters": [], "src": "951:0:4" }, "scope": 1150, "src": "911:146:4", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" }, { "body": { "id": 1148, "nodeType": "Block", "src": "1468:69:4", "statements": [ { "expression": { "argumentTypes": null, "components": [ { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "hexValue": "313030", "id": 1143, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1513:3:4", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_100_by_1", "typeString": "int_const 100" }, "value": "100" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_rational_100_by_1", "typeString": "int_const 100" } ], "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 1140, "name": "percentage", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1105, "src": "1497:10:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_uint256", "typeString": "uint256" } ], "expression": { "argumentTypes": null, "id": 1138, "name": "_value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1127, "src": "1486:6:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 1139, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "mul", "nodeType": "MemberAccess", "referencedDeclaration": 21215, "src": "1486:10:4", "typeDescriptions": { "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$", "typeString": "function (uint256,uint256) pure returns (uint256)" } }, "id": 1141, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1486:22:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 1142, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "div", "nodeType": "MemberAccess", "referencedDeclaration": 21239, "src": "1486:26:4", "typeDescriptions": { "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$", "typeString": "function (uint256,uint256) pure returns (uint256)" } }, "id": 1144, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1486:31:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, { "argumentTypes": null, "id": 1145, "name": "senderPays", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1108, "src": "1519:10:4", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } } ], "id": 1146, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", "src": "1485:45:4", "typeDescriptions": { "typeIdentifier": "t_tuple$_t_uint256_$_t_bool_$", "typeString": "tuple(uint256,bool)" } }, "functionReturnParameters": 1137, "id": 1147, "nodeType": "Return", "src": "1478:52:4" } ] }, "documentation": "@dev calculates the fee of given value.\n@param _value the value of the transaction to calculate fees from\n@param _sender address sending.\n @param _recipient address receiving.\n@return the transactional fee for given value", "id": 1149, "implemented": true, "kind": "function", "modifiers": [], "name": "getTxFees", "nodeType": "FunctionDefinition", "parameters": { "id": 1132, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1127, "name": "_value", "nodeType": "VariableDeclaration", "scope": 1149, "src": "1358:14:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1126, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1358:7:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 1129, "name": "_sender", "nodeType": "VariableDeclaration", "scope": 1149, "src": "1382:15:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 1128, "name": "address", "nodeType": "ElementaryTypeName", "src": "1382:7:4", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 1131, "name": "_recipient", "nodeType": "VariableDeclaration", "scope": 1149, "src": "1407:18:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 1130, "name": "address", "nodeType": "ElementaryTypeName", "sr