@gooddollar/goodcontracts
Version:
GoodDollar Contracts
841 lines • 85.6 kB
JSON
{
"contractName": "SenderFeeFormula",
"abi": [
{
"inputs": [
{
"internalType": "uint256",
"name": "_percentage",
"type": "uint256"
}
],
"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": true,
"inputs": [],
"name": "percentage",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [],
"name": "renounceOwnership",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "senderPays",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "view",
"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\":[{\"internalType\":\"uint256\",\"name\":\"_percentage\",\"type\":\"uint256\"}],\"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\":true,\"inputs\":[],\"name\":\"percentage\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"senderPays\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"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\":{\"constructor\":{\"details\":\"Constructor. Requires the given percentage parameter to be less than 100.\",\"params\":{\"_percentage\":\"the percentage to calculate fees of\"}},\"getTxFees(uint256,address,address)\":{\"details\":\"calculates the fee of given value.\",\"params\":{\"_recipient\":\"address receiving.\",\"_sender\":\"address sending.\",\"_value\":\"the value of the transaction to calculate fees from\"},\"return\":\"the transactional fee for given value\"},\"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 contract contract that provides a function to calculate fees as a percentage of any given value\"},\"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/SenderFeeFormula.sol\":\"SenderFeeFormula\"},\"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\"]},\"/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/contracts/dao/schemes/SenderFeeFormula.sol\":{\"keccak256\":\"0x3fa70ed632b71cd66e528d12a8ed6556652ee53d2ea5723f8cc38614703f2b2f\",\"urls\":[\"bzz-raw://50b1033dbd374628f4f43c25b139e9823a20205961e2030c3f7bd943e5f35587\",\"dweb:/ipfs/QmbGot4yixQeKtULFgdVrWXCpNktxSfX5KtfHVCHdAbs9F\"]},\"@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": "0x6080604052600280546001600160a01b031916905534801561002057600080fd5b506040516107133803806107138339818101604052602081101561004357600080fd5b5051600080546001600160a01b03191633178082556040516001600160a01b03919091169082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3600180546001600160a01b0319166001600160a01b038381169190911791829055161561015057600160009054906101000a90046001600160a01b03166001600160a01b0316638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561010457600080fd5b505afa158015610118573d6000803e3d6000fd5b505050506040513d602081101561012e57600080fd5b5051600280546001600160a01b0319166001600160a01b039092169190911790555b50606481106101a6576040805162461bcd60e51b815260206004820152601960248201527f50657263656e746167652073686f756c64206265203c31303000000000000000604482015290519081900360640190fd5b60035561055b806101b86000396000f3fe608060405234801561001057600080fd5b506004361061009e5760003560e01c80638f32d59b116100665780638f32d59b14610160578063c3c5a54714610168578063c78ad77f1461018e578063e662c7f5146101a8578063f2fde38b146101b05761009e565b8063086cfca8146100a357806322366844146100cb5780633ddaa806146100e7578063715018a6146101345780638da5cb5b1461013c575b600080fd5b6100c9600480360360208110156100b957600080fd5b50356001600160a01b03166101d6565b005b6100d3610291565b604080519115158252519081900360200190f35b61011b600480360360608110156100fd57600080fd5b508035906001600160a01b03602082013581169160400135166102a1565b6040805192835290151560208301528051918290030190f35b6100c96102d6565b610144610331565b604080516001600160a01b039092168252519081900360200190f35b6100d3610340565b6100d36004803603602081101561017e57600080fd5b50356001600160a01b0316610351565b61019661043e565b60408051918252519081900360200190f35b6100d3610444565b6100c9600480360360208110156101c657600080fd5b50356001600160a01b0316610449565b6101de610340565b6101e757600080fd5b600180546001600160a01b0319166001600160a01b03838116919091179182905560408051638da5cb5b60e01b815290519290911691638da5cb5b91600480820192602092909190829003018186803b15801561024357600080fd5b505afa158015610257573d6000803e3d6000fd5b505050506040513d602081101561026d57600080fd5b5051600280546001600160a01b0319166001600160a01b0390921691909117905550565b600061029c30610351565b905090565b6000806102ca6003546102be60648861046690919063ffffffff16565b9063ffffffff61048a16565b95600195509350505050565b6102de610340565b6102e757600080fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031690565b6000546001600160a01b0316331490565b6001546000906001600160a01b03166103a5576040805162461bcd60e51b8152602060048201526011602482015270105d985d185c881a5cc81b9bdd081cd95d607a1b604482015290519081900360640190fd5b60025460015460408051639be2faed60e01b81526001600160a01b038681166004830152928316602482015290519190921691639be2faed916044808301926020929190829003018186803b1580156103fd57600080fd5b505afa158015610411573d6000803e3d6000fd5b505050506040513d602081101561042757600080fd5b505161043557506000610439565b5060015b919050565b60035481565b600181565b610451610340565b61045a57600080fd5b610463816104b8565b50565b600080821161047457600080fd5b600082848161047f57fe5b049150505b92915050565b60008261049957506000610484565b828202828482816104a657fe5b04146104b157600080fd5b9392505050565b6001600160a01b0381166104cb57600080fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b039290921691909117905556fea265627a7a723158209422a39736a9bbaff188c3426f84cc5685fa63be9abc239052f0ca40cd5b6f6b64736f6c63430005100032",
"deployedBytecode": "0x608060405234801561001057600080fd5b506004361061009e5760003560e01c80638f32d59b116100665780638f32d59b14610160578063c3c5a54714610168578063c78ad77f1461018e578063e662c7f5146101a8578063f2fde38b146101b05761009e565b8063086cfca8146100a357806322366844146100cb5780633ddaa806146100e7578063715018a6146101345780638da5cb5b1461013c575b600080fd5b6100c9600480360360208110156100b957600080fd5b50356001600160a01b03166101d6565b005b6100d3610291565b604080519115158252519081900360200190f35b61011b600480360360608110156100fd57600080fd5b508035906001600160a01b03602082013581169160400135166102a1565b6040805192835290151560208301528051918290030190f35b6100c96102d6565b610144610331565b604080516001600160a01b039092168252519081900360200190f35b6100d3610340565b6100d36004803603602081101561017e57600080fd5b50356001600160a01b0316610351565b61019661043e565b60408051918252519081900360200190f35b6100d3610444565b6100c9600480360360208110156101c657600080fd5b50356001600160a01b0316610449565b6101de610340565b6101e757600080fd5b600180546001600160a01b0319166001600160a01b03838116919091179182905560408051638da5cb5b60e01b815290519290911691638da5cb5b91600480820192602092909190829003018186803b15801561024357600080fd5b505afa158015610257573d6000803e3d6000fd5b505050506040513d602081101561026d57600080fd5b5051600280546001600160a01b0319166001600160a01b0390921691909117905550565b600061029c30610351565b905090565b6000806102ca6003546102be60648861046690919063ffffffff16565b9063ffffffff61048a16565b95600195509350505050565b6102de610340565b6102e757600080fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031690565b6000546001600160a01b0316331490565b6001546000906001600160a01b03166103a5576040805162461bcd60e51b8152602060048201526011602482015270105d985d185c881a5cc81b9bdd081cd95d607a1b604482015290519081900360640190fd5b60025460015460408051639be2faed60e01b81526001600160a01b038681166004830152928316602482015290519190921691639be2faed916044808301926020929190829003018186803b1580156103fd57600080fd5b505afa158015610411573d6000803e3d6000fd5b505050506040513d602081101561042757600080fd5b505161043557506000610439565b5060015b919050565b60035481565b600181565b610451610340565b61045a57600080fd5b610463816104b8565b50565b600080821161047457600080fd5b600082848161047f57fe5b049150505b92915050565b60008261049957506000610484565b828202828482816104a657fe5b04146104b157600080fd5b9392505050565b6001600160a01b0381166104cb57600080fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b039290921691909117905556fea265627a7a723158209422a39736a9bbaff188c3426f84cc5685fa63be9abc239052f0ca40cd5b6f6b64736f6c63430005100032",
"sourceMap": "330:956:23:-;;;443:64:22;;;-1:-1:-1;;;;;;443:64:22;;;658:146:23;5:2:-1;;;;30:1;27;20:12;5:2;658:146:23;;;;;;;;;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;658:146:23;302:1:11;515:19:72;;-1:-1:-1;;;;;;515:19:72;524:10;515:19;;;;549:40;;-1:-1:-1;;;;;582:6:72;;;;;302:1:11;;549:40:72;;302:1:11;;549:40:72;688:6:22;:16;;-1:-1:-1;;;;;;688:16:22;-1:-1:-1;;;;;688:16:22;;;;;;;;;;;719:6;:19;715:98;;787:6;;;;;;;;;-1:-1:-1;;;;;787:6:22;-1:-1:-1;;;;;787:12:22;;:14;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;787:14:22;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;787:14:22;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;787:14:22;754:10;:48;;-1:-1:-1;;;;;;754:48:22;-1:-1:-1;;;;;754:48:22;;;;;;;;;715:98;643:176;730:3:23;716:11;:17;708:55;;;;;-1:-1:-1;;;708:55:23;;;;;;;;;;;;;;;;;;;;;;;;;;;;773:10;:24;330:956;;;;;;",
"deployedSourceMap": "330:956:23:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;330:956:23;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1698:143:22;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1698:143:22;-1:-1:-1;;;;;1698:143:22;;:::i;:::-;;1987:102;;;:::i;:::-;;;;;;;;;;;;;;;;;;1077:207:23;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1077:207:23;;;-1:-1:-1;;;;;1077:207:23;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;1347:137:72;;;:::i;659:77::-;;;:::i;:::-;;;;-1:-1:-1;;;;;659:77:72;;;;;;;;;;;;;;979:90;;;:::i;2235:262:22:-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;2235:262:22;-1:-1:-1;;;;;2235:262:22;;:::i;411:25:23:-;;;:::i;:::-;;;;;;;;;;;;;;;;442:38;;;:::i;1655:107:72:-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1655:107:72;-1:-1:-1;;;;;1655:107:72;;:::i;1698:143:22:-;863:9:72;:7;:9::i;:::-;855:18;;;;;;1760:6:22;:16;;-1:-1:-1;;;;;;1760:16:22;-1:-1:-1;;;;;1760:16:22;;;;;;;;;;;1819:14;;;-1:-1:-1;;;1819:14:22;;;;:6;;;;;:12;;:14;;;;;;;;;;;;;;;:6;:14;;;5:2:-1;;;;30:1;27;20:12;5:2;1819:14:22;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1819:14:22;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1819:14:22;1786:10;:48;;-1:-1:-1;;;;;;1786:48:22;-1:-1:-1;;;;;1786:48:22;;;;;;;;;-1:-1:-1;1698:143:22:o;1987:102::-;2032:4;2055:27;2076:4;2055:12;:27::i;:::-;2048:34;;1987:102;:::o;1077:207:23:-;1200:7;1209:4;1233:31;1253:10;;1233:15;1244:3;1233:6;:10;;:15;;;;:::i;:::-;:19;:31;:19;:31;:::i;:::-;1225:52;476:4;;-1:-1:-1;1077:207:23;-1:-1:-1;;;;1077:207:23:o;1347:137:72:-;863:9;:7;:9::i;:::-;855:18;;;;;;1445:1;1429:6;;1408:40;;-1:-1:-1;;;;;1429:6:72;;;;1408:40;;1445:1;;1408:40;1475:1;1458:19;;-1:-1:-1;;;;;;1458:19:72;;;1347:137::o;659:77::-;697:7;723:6;-1:-1:-1;;;;;723:6:72;659:77;:::o;979:90::-;1019:4;1056:6;-1:-1:-1;;;;;1056:6:72;1042:10;:20;;979:90::o;2235:262:22:-;2318:6;;2294:4;;-1:-1:-1;;;;;2318:6:22;2310:49;;;;;-1:-1:-1;;;2310:49:22;;;;;;;;;;;;-1:-1:-1;;;2310:49:22;;;;;;;;;;;;;;;2376:10;;;2422:6;2376:54;;;-1:-1:-1;;;2376:54:22;;-1:-1:-1;;;;;2376:54:22;;;;;;;2422:6;;;2376:54;;;;;;:10;;;;;:29;;:54;;;;;;;;;;;;;;:10;:54;;;5:2:-1;;;;30:1;27;20:12;5:2;2376:54:22;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;2376:54:22;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;2376:54:22;2370:100;;-1:-1:-1;2454:5:22;2447:12;;2370:100;-1:-1:-1;2486:4:22;2235:262;;;;:::o;411:25:23:-;;;;:::o;442:38::-;476:4;442:38;:::o;1655:107:72:-;863:9;:7;:9::i;:::-;855:18;;;;;;1727:28;1746:8;1727:18;:28::i;:::-;1655:107;:::o;778:296:71:-;836:7;933:1;929;:5;921:14;;;;;;945:9;961:1;957;:5;;;;;;;-1:-1:-1;;778:296:71;;;;;:::o;229:421::-;287:7;527:6;523:45;;-1:-1:-1;556:1:71;549:8;;523:45;590:5;;;594:1;590;:5;:1;613:5;;;;;:10;605:19;;;;;;642:1;229:421;-1:-1:-1;;;229:421:71:o;1906:183:72:-;-1:-1:-1;;;;;1979:22:72;;1971:31;;;;;;2038:6;;;2017:38;;-1:-1:-1;;;;;2017:38:72;;;;2038:6;;;2017:38;;;2065:6;:17;;-1:-1:-1;;;;;;2065:17:72;-1:-1:-1;;;;;2065:17:72;;;;;;;;;;1906:183::o",
"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\";\nimport \"./FeeFormula.sol\";\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 SenderFeeFormula is AbstractFees {\n using SafeMath for uint256;\n\n uint256 public percentage;\n bool public constant senderPays = true;\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.div(100).mul(percentage), senderPays);\n }\n}\n",
"sourcePath": "/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/contracts/dao/schemes/SenderFeeFormula.sol",
"ast": {
"absolutePath": "/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/contracts/dao/schemes/SenderFeeFormula.sol",
"exportedSymbols": {
"SenderFeeFormula": [
4240
]
},
"id": 4241,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 4184,
"literals": [
"solidity",
">",
"0.5",
".4"
],
"nodeType": "PragmaDirective",
"src": "0:23:23"
},
{
"absolutePath": "openzeppelin-solidity/contracts/math/SafeMath.sol",
"file": "openzeppelin-solidity/contracts/math/SafeMath.sol",
"id": 4185,
"nodeType": "ImportDirective",
"scope": 4241,
"sourceUnit": 17145,
"src": "25:59:23",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "@daostack/arc/contracts/controller/Avatar.sol",
"file": "@daostack/arc/contracts/controller/Avatar.sol",
"id": 4186,
"nodeType": "ImportDirective",
"scope": 4241,
"sourceUnit": 8542,
"src": "85:55:23",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/contracts/dao/schemes/SchemeGuard.sol",
"file": "./SchemeGuard.sol",
"id": 4187,
"nodeType": "ImportDirective",
"scope": 4241,
"sourceUnit": 4183,
"src": "142:27:23",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/contracts/dao/schemes/FeeFormula.sol",
"file": "./FeeFormula.sol",
"id": 4188,
"nodeType": "ImportDirective",
"scope": 4241,
"sourceUnit": 2634,
"src": "170:26:23",
"symbolAliases": [],
"unitAlias": ""
},
{
"baseContracts": [
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 4189,
"name": "AbstractFees",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 2581,
"src": "359:12:23",
"typeDescriptions": {
"typeIdentifier": "t_contract$_AbstractFees_$2581",
"typeString": "contract AbstractFees"
}
},
"id": 4190,
"nodeType": "InheritanceSpecifier",
"src": "359:12:23"
}
],
"contractDependencies": [
2581,
4182,
17253
],
"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": 4240,
"linearizedBaseContracts": [
4240,
2581,
4182,
17253
],
"name": "SenderFeeFormula",
"nodeType": "ContractDefinition",
"nodes": [
{
"id": 4193,
"libraryName": {
"contractScope": null,
"id": 4191,
"name": "SafeMath",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 17144,
"src": "384:8:23",
"typeDescriptions": {
"typeIdentifier": "t_contract$_SafeMath_$17144",
"typeString": "library SafeMath"
}
},
"nodeType": "UsingForDirective",
"src": "378:27:23",
"typeName": {
"id": 4192,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "397:7:23",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
},
{
"constant": false,
"id": 4195,
"name": "percentage",
"nodeType": "VariableDeclaration",
"scope": 4240,
"src": "411:25:23",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 4194,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "411:7:23",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "public"
},
{
"constant": true,
"id": 4198,
"name": "senderPays",
"nodeType": "VariableDeclaration",
"scope": 4240,
"src": "442:38:23",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 4196,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "442:4:23",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": {
"argumentTypes": null,
"hexValue": "74727565",
"id": 4197,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "476:4:23",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
},
"visibility": "public"
},
{
"body": {
"id": 4214,
"nodeType": "Block",
"src": "698:106:23",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 4206,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 4204,
"name": "_percentage",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 4200,
"src": "716:11:23",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"hexValue": "313030",
"id": 4205,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "730:3:23",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_100_by_1",
"typeString": "int_const 100"
},
"value": "100"
},
"src": "716:17:23",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "50657263656e746167652073686f756c64206265203c313030",
"id": 4207,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "735:27:23",
"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": 4203,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
18010,
18011
],
"referencedDeclaration": 18011,
"src": "708:7:23",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 4208,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "708:55:23",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 4209,
"nodeType": "ExpressionStatement",
"src": "708:55:23"
},
{
"expression": {
"argumentTypes": null,
"id": 4212,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 4210,
"name": "percentage",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 4195,
"src": "773:10:23",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 4211,
"name": "_percentage",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 4200,
"src": "786:11:23",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "773:24:23",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 4213,
"nodeType": "ExpressionStatement",
"src": "773:24:23"
}
]
},
"documentation": "@dev Constructor. Requires the given percentage parameter\nto be less than 100.\n@param _percentage the percentage to calculate fees of",
"id": 4215,
"implemented": true,
"kind": "constructor",
"modifiers": [],
"name": "",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 4201,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 4200,
"name": "_percentage",
"nodeType": "VariableDeclaration",
"scope": 4215,
"src": "670:19:23",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 4199,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "670:7:23",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "669:21:23"
},
"returnParameters": {
"id": 4202,
"nodeType": "ParameterList",
"parameters": [],
"src": "698:0:23"
},
"scope": 4240,
"src": "658:146:23",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 4238,
"nodeType": "Block",
"src": "1215:69:23",
"statements": [
{
"expression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 4233,
"name": "percentage",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 4195,
"src": "1253:10:23",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "313030",
"id": 4230,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1244:3:23",
"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,
"id": 4228,
"name": "_value",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 4217,
"src": "1233:6:23",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 4229,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "div",
"nodeType": "MemberAccess",
"referencedDeclaration": 17075,
"src": "1233:10:23",
"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": 4231,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1233:15:23",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 4232,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "mul",
"nodeType": "MemberAccess",
"referencedDeclaration": 17051,
"src": "1233:19:23",
"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": 4234,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1233:31:23",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 4235,
"name": "senderPays",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 4198,
"src": "1266:10:23",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"id": 4236,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "1232:45:23",
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint256_$_t_bool_$",
"typeString": "tuple(uint256,bool)"
}
},
"functionReturnParameters": 4227,
"id": 4237,
"nodeType": "Return",
"src": "1225:52:23"
}
]
},
"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": 4239,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "getTxFees",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 4222,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 4217,
"name": "_value",
"nodeType": "VariableDeclaration",
"scope": 4239,
"src": "1105:14:23",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 4216,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1105:7:23",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 421