UNPKG

@gooddollar/goodcontracts

Version:
688 lines 189 kB
{ "contractName": "ContributionCalculation", "abi": [ { "inputs": [ { "internalType": "contract Avatar", "name": "_avatar", "type": "address" }, { "internalType": "uint256", "name": "_nom", "type": "uint256" }, { "internalType": "uint256", "name": "_denom", "type": "uint256" } ], "payable": false, "stateMutability": "nonpayable", "type": "constructor" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "caller", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "nom", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "denom", "type": "uint256" } ], "name": "SellContributionRatioUpdated", "type": "event" }, { "constant": true, "inputs": [], "name": "sellContributionRatio", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [ { "internalType": "uint256", "name": "_nom", "type": "uint256" }, { "internalType": "uint256", "name": "_denom", "type": "uint256" } ], "name": "setContributionRatio", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [ { "internalType": "contract GoodMarketMaker", "name": "_marketMaker", "type": "address" }, { "internalType": "contract GoodReserveCDai", "name": "_reserve", "type": "address" }, { "internalType": "address", "name": "_contributer", "type": "address" }, { "internalType": "contract ERC20", "name": "_token", "type": "address" }, { "internalType": "uint256", "name": "_gdAmount", "type": "uint256" } ], "name": "calculateContribution", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" } ], "metadata": "{\"compiler\":{\"version\":\"0.5.16+commit.9c3226ce\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract Avatar\",\"name\":\"_avatar\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_nom\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_denom\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"nom\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"denom\",\"type\":\"uint256\"}],\"name\":\"SellContributionRatioUpdated\",\"type\":\"event\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"contract GoodMarketMaker\",\"name\":\"_marketMaker\",\"type\":\"address\"},{\"internalType\":\"contract GoodReserveCDai\",\"name\":\"_reserve\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_contributer\",\"type\":\"address\"},{\"internalType\":\"contract ERC20\",\"name\":\"_token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_gdAmount\",\"type\":\"uint256\"}],\"name\":\"calculateContribution\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"sellContributionRatio\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_nom\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_denom\",\"type\":\"uint256\"}],\"name\":\"setContributionRatio\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"methods\":{\"calculateContribution(address,address,address,address,uint256)\":{\"details\":\"Calculate the amount after contribution during the sell action. There is a `sellContributionRatio` percent contribution\",\"params\":{\"_contributer\":\"The contributer address\",\"_gdAmount\":\"The total GD amount to contribute from\",\"_marketMaker\":\"The market maker address\",\"_reserve\":\"The reserve address\",\"_token\":\"The token to convert from\"},\"return\":\"(contributionAmount) The contribution amount for sell\"},\"constructor\":{\"details\":\"Constructor\",\"params\":{\"_avatar\":\"The avatar of the DAO\",\"_denom\":\"The denominator to calculate the contribution ratio from\",\"_nom\":\"The numerator to calculate the contribution ratio from\"}},\"setContributionRatio(uint256,uint256)\":{\"details\":\"Allow the DAO to change the sell contribution rate it is calculated by _nom/_denom with e27 precision. Emits that the contribution ratio was updated.\",\"params\":{\"_denom\":\"the denominator\",\"_nom\":\"the nominator\"}}}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/stakingModel/contracts/ContributionCalculation.sol\":\"ContributionCalculation\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/contracts/DSMath.sol\":{\"keccak256\":\"0x59fb5b1c4c3f68c1694f6ff5698016ac8ee9401b61e87473113dc103b7a6b0ff\",\"urls\":[\"bzz-raw://7410f43989dea44e64bed870958ce9199606dd8a9783e79fe8deca7b544164af\",\"dweb:/ipfs/QmPrrdvp2ErwL6SJSveB3JANo7ivadSMnk9gpWZD8nR7hy\"]},\"/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/contracts/dao/schemes/ActivePeriod.sol\":{\"keccak256\":\"0xd6b17fe8c789a03e87c80046319caee9fc9c9b5ded9008b09a550027c205c5ab\",\"urls\":[\"bzz-raw://0f77e8dc5f6abeefc9a2e185c257516f7f0266ae2781dd67c18daf1aac667daf\",\"dweb:/ipfs/QmbeRqLP2MvTZifqPBSK3PUDh8TjC1RaTA8b1dRRAXahmJ\"]},\"/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/FeelessScheme.sol\":{\"keccak256\":\"0x7c542d44cbd864ee0ddecbc5016d9d7eb9ce65ab463fdd9f21eb8ce3c6ffc8ea\",\"urls\":[\"bzz-raw://4753dd823c0b0cbe7d7d02e1df64ace07d7a163af3aaff12697aee70a1b45f2f\",\"dweb:/ipfs/QmPkKeH88M3f6UbHphayUbjEBNV4rmoogtDmVundzBKbFK\"]},\"/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/contracts/dao/schemes/FormulaHolder.sol\":{\"keccak256\":\"0xb3c0d3bc21e71497784e1be11698ff501ee11545c3106bec2cae2e8af1bacd9b\",\"urls\":[\"bzz-raw://783b4e28b67231de0fbbe48e58f43f69db3f98fd7f75668edce145a55a9b5b17\",\"dweb:/ipfs/QmdeyRfeix3PGfaXqtRQpH1sjmjFpdtuGaPwnvRn7nHAWd\"]},\"/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/identity/Identity.sol\":{\"keccak256\":\"0x282184478f1d618d3523b28a84a7f7003dfdc99cad120e5e358d2cce1f5fb491\",\"urls\":[\"bzz-raw://67e17ecb57b24c4fb801abc2c52c3148af3b967e28da4fb7e074d18efb7a57c1\",\"dweb:/ipfs/QmfZ8jXhdTHtxr3gfByRj4HnXnGynX7SLZWWGR8k768aGB\"]},\"/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/contracts/identity/IdentityAdminRole.sol\":{\"keccak256\":\"0x8e82c45eefe0da77d017144dfad12602c68124297035937901cdd08ce48c57ff\",\"urls\":[\"bzz-raw://e20e606342b3b35f41a081294cf3f716fe7e27e81d3090daa37c5208f4ef4bc3\",\"dweb:/ipfs/QmVEhHpiwVsksnPyHkfNa5LpTBLxoP9kj5NRZUBv456ewK\"]},\"/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/contracts/identity/IdentityGuard.sol\":{\"keccak256\":\"0xcc395c0e8f812201b5ed1f45e7272120ee5ffe73bfe13e325dfd872aef235b22\",\"urls\":[\"bzz-raw://58f93e4b9f48ec31ac151208e4f9e6b356cc23dfc9585d846bc09bf35d6ff7be\",\"dweb:/ipfs/QmdxJHUCaFx8N66kkDhYdA4k6d2V91yBRG6sombuPxBq7X\"]},\"/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/contracts/token/ERC677/ERC677.sol\":{\"keccak256\":\"0x8360b9e356df8584d95990bb7e772342b30d9e22b160f7c875fbca5c0b87453c\",\"urls\":[\"bzz-raw://97cc6e5586cedcd49462cc465a2a8fc5063d7ec6cb9533f4e0099969a75bd4b2\",\"dweb:/ipfs/QmXw6y4iXfqyJHDRrHdd5ofQ6E4cuHDw4LiYupReJ1rCBc\"]},\"/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/contracts/token/ERC677/ERC677Receiver.sol\":{\"keccak256\":\"0xc5683b28527097379ed090b28bb46e17a50a2c57ddcb3c7e028fcd04ddc64aef\",\"urls\":[\"bzz-raw://639f6b6cf65382faea738e6326d6aeb289b8b030cf02f40c54bc45ec098eda6d\",\"dweb:/ipfs/QmQi7dFcKiwUxSbzhus4CxFTdNJvUsfiqY6i3bD4RdMQrn\"]},\"/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/contracts/token/ERC677BridgeToken.sol\":{\"keccak256\":\"0x014fa09dca773b1406855e628687be50c1eb129894f45a8b5c9fc709d826968d\",\"urls\":[\"bzz-raw://23c6491c0c26471315010687d785a3724ae33198be6ed39828d1a4f7e6873cb4\",\"dweb:/ipfs/QmW62FXHtLdNGzB8Nq9XwmwHp6Jn8jgbAVyrU2j7c7w6By\"]},\"/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/contracts/token/ERC677Token.sol\":{\"keccak256\":\"0x553a103b911d77cecb2ce3f355b2370c4a23eb070593d7c8eb46f33e3a5ff141\",\"urls\":[\"bzz-raw://e37438ce280964498b77f63bbe4d1f25c55ff4c178925447a70decceda06e46c\",\"dweb:/ipfs/QmbqCLhWjZqpFBnUVb3H7LkEbAaVmhf76Ln14oWnGimYGM\"]},\"/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/contracts/token/GoodDollar.sol\":{\"keccak256\":\"0x7b91359f6912641c7dbfeced9a5c47454acce7c2cab9205d00b8049d228d7b78\",\"urls\":[\"bzz-raw://3a09bc6936d0179e2e5be2687446532d63135bc537f7ab246c6a1101d4849c1f\",\"dweb:/ipfs/QmNshqF7Xu7UX8BryKYRbnRQdTfytPappxkHq5xMxF5vpE\"]},\"/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/stakingModel/contracts/BancorFormula.sol\":{\"keccak256\":\"0xa8b83d6e46b4c2b5cf29c3572df676605ec37b8ef9b51ca6627ee225d9c51a77\",\"urls\":[\"bzz-raw://021c034dffe504492175527a436c00e898dfbf508ffb4e68f3e2a059f8934b61\",\"dweb:/ipfs/QmayhA4XBR7SYRQRRgngDcjRWUfJPmgMTbwskjZaEkznJ1\"]},\"/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/stakingModel/contracts/ContributionCalculation.sol\":{\"keccak256\":\"0x613f1ef48ba8b0ec74e516ea12d1f776bebd5d6dd3f943d4b396a1a7cbb2e393\",\"urls\":[\"bzz-raw://f44fe4e12225a3d032d07e300f32e62e88ba3b458f90aa0f1fca259180eb4892\",\"dweb:/ipfs/QmdQ9DeyRHVqKXQxxP9iv2ou4Ep9MDtYcWoGvMhWrnKuHT\"]},\"/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/stakingModel/contracts/GoodMarketMaker.sol\":{\"keccak256\":\"0x951b08d2bf3aa8d2da3322220bdff8473457ea52845a6c76ab7732bcbccaaf9a\",\"urls\":[\"bzz-raw://7728a9ba486bddaa950c37c033522af874d518e9b53e4f844320bed6e14d41eb\",\"dweb:/ipfs/QmdEFS6efb3QFWoWhvfy9xHBvykQVbfnF6raqUsn9mhAnu\"]},\"/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/stakingModel/contracts/GoodReserveCDai.sol\":{\"keccak256\":\"0x0fa6c1c0d54d076325a80278bf47e214dbb176b63c92bd0725983a530462794e\",\"urls\":[\"bzz-raw://87efa2ad8c36bf560ab4a3e982c518dcfa1c757595b0f2aeede8f70b8fd7a398\",\"dweb:/ipfs/QmNSdgBMBDMrv7WNXYQWhRFgRpDCW7gRW8VqPArcgE9yQH\"]},\"@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/access/Roles.sol\":{\"keccak256\":\"0x659ba0f9a3392cd50a8a5fafaf5dfd8c6a0878f6a4613bceff4e90dceddcd865\",\"urls\":[\"bzz-raw://4ca6617349a9b36fd82e9442a8e445ce9021a174e4399d1457ddc894ee3f5df3\",\"dweb:/ipfs/QmcmyB4cNazZ1sw963Afaijt67M9bDgwmGXCgQajGTD4tm\"]},\"openzeppelin-solidity/contracts/access/roles/MinterRole.sol\":{\"keccak256\":\"0x3199053db04cdae6c9b4380921a4a4ee720b568d6a9660883b29d25fbec31bc0\",\"urls\":[\"bzz-raw://1b0ff368e21d6007c06e4cfb286fe59d7d7d3ec06283300c9be2153ba11fa93a\",\"dweb:/ipfs/QmRPq2wZM4RAcbj31dP34GCr1CSy2qy3JqfXEkdVie4HLT\"]},\"openzeppelin-solidity/contracts/access/roles/PauserRole.sol\":{\"keccak256\":\"0x6506133e295a7199df2ac5dfc52853d9d767f68450b6d0193e9d8056b164ce86\",\"urls\":[\"bzz-raw://9c03592a9e6b1377e401b74eccf175a250232b5a341347d3fc5cb50e9bc86ba2\",\"dweb:/ipfs/QmYAr1yXT89hNUMJ37aiBpD9HtYfBDqmueVCzphRuuU7oZ\"]},\"openzeppelin-solidity/contracts/lifecycle/Pausable.sol\":{\"keccak256\":\"0x3b0ed31deeba7e3c6cfbbe8092a6b427084ee390800a06acdea5c17c8185d606\",\"urls\":[\"bzz-raw://bbdbf9d3754fcdcc85aec0432fabcec914317b1c2081b43753442ed53853a34a\",\"dweb:/ipfs/QmVHWQBn5xQkQEHhyGNEeS5gjjALZEk5ZfcjFt7kL6MoLy\"]},\"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/ERC20Detailed.sol\":{\"keccak256\":\"0xe195405e9993d575173cdb5dd408db7459a026b9a98085c1a3b676f020f46584\",\"urls\":[\"bzz-raw://f6beab874b52e710d2c42334e34bb5592146f7dd148d96ff32c0c474412bf2f4\",\"dweb:/ipfs/QmUKmVUX4Fif7dguPgC459cpGegiJd1s24YhgZUrBUkkDN\"]},\"openzeppelin-solidity/contracts/token/ERC20/ERC20Mintable.sol\":{\"keccak256\":\"0xc4ca2883e0b0743604143952024c250bb13737ad54bb666b117efdcb766fe3a8\",\"urls\":[\"bzz-raw://bdaf72028f2dc29aa5191b2bfca315a9e3b1d58f900166bdb5ae5f500d569384\",\"dweb:/ipfs/QmZngPiWLXA9i2vp6XNPcGA23GHxT99V1Qma6iRivtbREy\"]},\"openzeppelin-solidity/contracts/token/ERC20/ERC20Pausable.sol\":{\"keccak256\":\"0x37b840977505e5f6d74bc8fa3d0217facc7913d0ecf064da3e3b26494acd37de\",\"urls\":[\"bzz-raw://7456513521bae915089dfd5879b685e47f3f180ad9ffe24cc3b19275b1da28ed\",\"dweb:/ipfs/QmbM1avKkyyTHEeTs3CqheyZwgAMNzVi3iDudqBdUJ2WPM\"]},\"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": "0x608060405234801561001057600080fd5b506040516105c33803806105c38339818101604052606081101561003357600080fd5b508051602082015160409092015190919061005782826001600160e01b0361008116565b6001555050600080546001600160a01b0319166001600160a01b0392909216919091179055610191565b6000816100b86100a6856b033b2e3c9fd0803ce80000006001600160e01b036100c716565b600285046001600160e01b0361013916565b816100bf57fe5b049392505050565b60008115806100e2575050808202828282816100df57fe5b04145b610133576040805162461bcd60e51b815260206004820152601460248201527f64732d6d6174682d6d756c2d6f766572666c6f77000000000000000000000000604482015290519081900360640190fd5b92915050565b80820182811015610133576040805162461bcd60e51b815260206004820152601460248201527f64732d6d6174682d6164642d6f766572666c6f77000000000000000000000000604482015290519081900360640190fd5b610423806101a06000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c80631f06244f146100465780632cfa94fe1461006b5780634be29dd5146100c3575b600080fd5b6100696004803603604081101561005c57600080fd5b50803590602001356100cb565b005b6100b1600480360360a081101561008157600080fd5b506001600160a01b03813581169160208101358216916040820135811691606081013590911690608001356101ca565b60408051918252519081900360200190f35b6100b1610267565b6000546001600160a01b0316331461012a576040805162461bcd60e51b815260206004820181905260248201527f6f6e6c79204176617461722063616e2063616c6c2074686973206d6574686f64604482015290519081900360640190fd5b6000811161017f576040805162461bcd60e51b815260206004820152601b60248201527f64656e6f6d696e61746f72206d7573742062652061626f766520300000000000604482015290519081900360640190fd5b610189828261026d565b6001556040805183815260208101839052815133927f039f8bf61b98a6e6b60eefc7000bbe99e429118add8275a51b89a68efdf76728928290030190a25050565b6000806101df601b600263ffffffff6102a216565b90506000610212600a83900a6102066101fe878363ffffffff6102bc16565b6001546102ea565b9063ffffffff61031a16565b905080841161025c576040805162461bcd60e51b815260206004820152601160248201527021b0b631bab630ba34b7b71032b93937b960791b604482015290519081900360640190fd5b979650505050505050565b60015481565b600081610293610289856b033b2e3c9fd0803ce800000061033c565b6002855b0461039f565b8161029a57fe5b049392505050565b6000828211156102b157600080fd5b508082035b92915050565b6000826102cb575060006102b6565b828202828482816102d857fe5b04146102e357600080fd5b9392505050565b60006b033b2e3c9fd0803ce8000000610293610306858561033c565b60026b033b2e3c9fd0803ce800000061028d565b600080821161032857600080fd5b600082848161033357fe5b04949350505050565b60008115806103575750508082028282828161035457fe5b04145b6102b6576040805162461bcd60e51b815260206004820152601460248201527364732d6d6174682d6d756c2d6f766572666c6f7760601b604482015290519081900360640190fd5b808201828110156102b6576040805162461bcd60e51b815260206004820152601460248201527364732d6d6174682d6164642d6f766572666c6f7760601b604482015290519081900360640190fdfea265627a7a723158207d4ee9b7e5c28b315bbf66ba91d109cc01f1adaa9fff8e909ec05dc50ce77ea064736f6c63430005100032", "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100415760003560e01c80631f06244f146100465780632cfa94fe1461006b5780634be29dd5146100c3575b600080fd5b6100696004803603604081101561005c57600080fd5b50803590602001356100cb565b005b6100b1600480360360a081101561008157600080fd5b506001600160a01b03813581169160208101358216916040820135811691606081013590911690608001356101ca565b60408051918252519081900360200190f35b6100b1610267565b6000546001600160a01b0316331461012a576040805162461bcd60e51b815260206004820181905260248201527f6f6e6c79204176617461722063616e2063616c6c2074686973206d6574686f64604482015290519081900360640190fd5b6000811161017f576040805162461bcd60e51b815260206004820152601b60248201527f64656e6f6d696e61746f72206d7573742062652061626f766520300000000000604482015290519081900360640190fd5b610189828261026d565b6001556040805183815260208101839052815133927f039f8bf61b98a6e6b60eefc7000bbe99e429118add8275a51b89a68efdf76728928290030190a25050565b6000806101df601b600263ffffffff6102a216565b90506000610212600a83900a6102066101fe878363ffffffff6102bc16565b6001546102ea565b9063ffffffff61031a16565b905080841161025c576040805162461bcd60e51b815260206004820152601160248201527021b0b631bab630ba34b7b71032b93937b960791b604482015290519081900360640190fd5b979650505050505050565b60015481565b600081610293610289856b033b2e3c9fd0803ce800000061033c565b6002855b0461039f565b8161029a57fe5b049392505050565b6000828211156102b157600080fd5b508082035b92915050565b6000826102cb575060006102b6565b828202828482816102d857fe5b04146102e357600080fd5b9392505050565b60006b033b2e3c9fd0803ce8000000610293610306858561033c565b60026b033b2e3c9fd0803ce800000061028d565b600080821161032857600080fd5b600082848161033357fe5b04949350505050565b60008115806103575750508082028282828161035457fe5b04145b6102b6576040805162461bcd60e51b815260206004820152601460248201527364732d6d6174682d6d756c2d6f766572666c6f7760601b604482015290519081900360640190fd5b808201828110156102b6576040805162461bcd60e51b815260206004820152601460248201527364732d6d6174682d6164642d6f766572666c6f7760601b604482015290519081900360640190fdfea265627a7a723158207d4ee9b7e5c28b315bbf66ba91d109cc01f1adaa9fff8e909ec05dc50ce77ea064736f6c63430005100032", "sourceMap": "357:2669:22:-;;;1193:180;8:9:-1;5:2;;;30:1;27;20:12;5:2;1193:180:22;;;;;;;;;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1193:180:22;;;;;;;;;;;;;;1322:18;1193:180;;-1:-1:-1;;;;;1322:4:22;:18;:::i;:::-;1298:21;:42;-1:-1:-1;;1350:6:22;:16;;-1:-1:-1;;;;;;1350:16:22;-1:-1:-1;;;;;1350:16:22;;;;;;;;;;357:2669;;2069:118:0;2128:9;2179:1;2153:23;2157:11;2161:1;1683:6;-1:-1:-1;;;;;2157:3:0;:11;:::i;:::-;2174:1;2170;:5;-1:-1:-1;;;;;2153:3:0;:23;:::i;:::-;:27;;;;;;;2069:118;-1:-1:-1;;;2069:118:0:o;1025:149::-;1083:9;1112:6;;;:30;;-1:-1:-1;;1127:5:0;;;1141:1;1136;1127:5;1136:1;1122:15;;;;;:20;1112:30;1104:63;;;;;-1:-1:-1;;;1104:63:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;1025:149;;;;:::o;744:135::-;836:5;;;831:16;;;;823:49;;;;;-1:-1:-1;;;823:49:0;;;;;;;;;;;;;;;;;;;;;;;;;;;357:2669:22;;;;;;;", "deployedSourceMap": "357:2669:22:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;357:2669:22;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1641:268;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1641:268:22;;;;;;;:::i;:::-;;2395:629;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;-1:-1;;;;;;2395:629:22;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;550:36;;;:::i;1641:268::-;875:6;;-1:-1:-1;;;;;875:6:22;886:10;867:29;859:74;;;;;-1:-1:-1;;;859:74:22;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1748:1;1739:6;:10;1731:50;;;;;-1:-1:-1;;;1731:50:22;;;;;;;;;;;;;;;;;;;;;;;;;;;;1815:18;1820:4;1826:6;1815:4;:18::i;:::-;1791:21;:42;1848:54;;;;;;;;;;;;;;1877:10;;1848:54;;;;;;;;1641:268;;:::o;2395:629::-;2606:7;;2648:18;2656:2;2664:1;2648:18;:15;:18;:::i;:::-;2625:41;-1:-1:-1;2701:26:22;2730:156;2869:2;:16;;;2730:121;2748:31;:9;2869:16;2748:31;:13;:31;:::i;:::-;2820:21;;2730:4;:121::i;:::-;:138;:156;:138;:156;:::i;:::-;2701:185;;2942:18;2930:9;:30;2922:60;;;;;-1:-1:-1;;;2922:60:22;;;;;;;;;;;;-1:-1:-1;;;2922:60:22;;;;;;;;;;;;;;;2999:18;2395:629;-1:-1:-1;;;;;;;2395:629:22:o;550:36::-;;;;:::o;2069:118:0:-;2128:9;2179:1;2153:23;2157:11;2161:1;1683:6;2157:3;:11::i;:::-;2174:1;2170;:5;;2153:3;:23::i;:::-;:27;;;;;;;2069:118;-1:-1:-1;;;2069:118:0:o;1205:145:76:-;1263:7;1295:1;1290;:6;;1282:15;;;;;;-1:-1:-1;1319:5:76;;;1205:145;;;;;:::o;229:421::-;287:7;527:6;523:45;;-1:-1:-1;556:1:76;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:76:o;1821:120:0:-;1880:9;1683:6;1905:23;1909:9;1913:1;1916;1909:3;:9::i;:::-;1926:1;1683:6;1920:7;;778:296:76;836:7;933:1;929;:5;921:14;;;;;;945:9;961:1;957;:5;;;;;;;778:296;-1:-1:-1;;;;778:296:76:o;1025:149:0:-;1083:9;1112:6;;;:30;;-1:-1:-1;;1127:5:0;;;1141:1;1136;1127:5;1136:1;1122:15;;;;;:20;1112:30;1104:63;;;;;-1:-1:-1;;;1104:63:0;;;;;;;;;;;;-1:-1:-1;;;1104:63:0;;;;;;;;;;;;;;744:135;836:5;;;831:16;;;;823:49;;;;;-1:-1:-1;;;823:49:0;;;;;;;;;;;;-1:-1:-1;;;823:49:0;;;;;;;;;;;;;", "source": "pragma solidity >0.5.4;\nimport \"openzeppelin-solidity/contracts/math/SafeMath.sol\";\nimport \"@daostack/arc/contracts/controller/Avatar.sol\";\nimport \"../../contracts/dao/schemes/SchemeGuard.sol\";\nimport \"./GoodMarketMaker.sol\";\nimport \"./GoodReserveCDai.sol\";\nimport \"../../contracts/DSMath.sol\";\n\n/* @title Contribution calculation for selling gd tokens\n */\ncontract ContributionCalculation is DSMath {\n using SafeMath for uint256;\n\n Avatar avatar;\n // The contribution ratio, declares how much\n // to contribute from the given amount\n uint256 public sellContributionRatio;\n\n // Emits when the contribution ratio is updated\n event SellContributionRatioUpdated(\n address indexed caller,\n uint256 nom,\n uint256 denom\n );\n\n /** @dev modifier to check if caller is avatar\n */\n modifier onlyAvatar() {\n require(address(avatar) == msg.sender, \"only Avatar can call this method\");\n _;\n }\n\n /**\n * @dev Constructor\n * @param _avatar The avatar of the DAO\n * @param _nom The numerator to calculate the contribution ratio from\n * @param _denom The denominator to calculate the contribution ratio from\n */\n constructor(\n Avatar _avatar,\n uint256 _nom,\n uint256 _denom\n ) public {\n sellContributionRatio = rdiv(_nom, _denom);\n avatar = _avatar;\n }\n\n /**\n * @dev Allow the DAO to change the sell contribution rate\n * it is calculated by _nom/_denom with e27 precision. Emits\n * that the contribution ratio was updated.\n * @param _nom the nominator\n * @param _denom the denominator\n */\n function setContributionRatio(uint256 _nom, uint256 _denom) external onlyAvatar {\n require(_denom > 0, \"denominator must be above 0\");\n sellContributionRatio = rdiv(_nom, _denom);\n emit SellContributionRatioUpdated(msg.sender, _nom, _denom);\n }\n\n /**\n * @dev Calculate the amount after contribution during the sell action. There is a\n * `sellContributionRatio` percent contribution\n * @param _marketMaker The market maker address\n * @param _reserve The reserve address\n * @param _contributer The contributer address\n * @param _token The token to convert from\n * @param _gdAmount The total GD amount to contribute from\n * @return (contributionAmount) The contribution amount for sell\n */\n function calculateContribution(\n GoodMarketMaker _marketMaker,\n GoodReserveCDai _reserve,\n address _contributer,\n ERC20 _token,\n uint256 _gdAmount\n ) external view returns (uint256) {\n uint256 decimalsDiff = uint256(27).sub(2); // 2 gooddollar decimals\n uint256 contributionAmount = rmul(\n _gdAmount.mul(10**decimalsDiff), // expand to e27 precision\n sellContributionRatio\n )\n .div(10**decimalsDiff); // return to e2 precision\n require(_gdAmount > contributionAmount, \"Calculation error\");\n return contributionAmount;\n }\n}\n", "sourcePath": "/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/stakingModel/contracts/ContributionCalculation.sol", "ast": { "absolutePath": "/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/stakingModel/contracts/ContributionCalculation.sol", "exportedSymbols": { "ContributionCalculation": [ 6760 ] }, "id": 6761, "nodeType": "SourceUnit", "nodes": [ { "id": 6619, "literals": [ "solidity", ">", "0.5", ".4" ], "nodeType": "PragmaDirective", "src": "0:23:22" }, { "absolutePath": "openzeppelin-solidity/contracts/math/SafeMath.sol", "file": "openzeppelin-solidity/contracts/math/SafeMath.sol", "id": 6620, "nodeType": "ImportDirective", "scope": 6761, "sourceUnit": 21309, "src": "24:59:22", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "@daostack/arc/contracts/controller/Avatar.sol", "file": "@daostack/arc/contracts/controller/Avatar.sol", "id": 6621, "nodeType": "ImportDirective", "scope": 6761, "sourceUnit": 12706, "src": "84:55:22", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/contracts/dao/schemes/SchemeGuard.sol", "file": "../../contracts/dao/schemes/SchemeGuard.sol", "id": 6622, "nodeType": "ImportDirective", "scope": 6761, "sourceUnit": 1424, "src": "140:53:22", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/stakingModel/contracts/GoodMarketMaker.sol", "file": "./GoodMarketMaker.sol", "id": 6623, "nodeType": "ImportDirective", "scope": 6761, "sourceUnit": 8275, "src": "194:31:22", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/stakingModel/contracts/GoodReserveCDai.sol", "file": "./GoodReserveCDai.sol", "id": 6624, "nodeType": "ImportDirective", "scope": 6761, "sourceUnit": 9044, "src": "226:31:22", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/contracts/DSMath.sol", "file": "../../contracts/DSMath.sol", "id": 6625, "nodeType": "ImportDirective", "scope": 6761, "sourceUnit": 304, "src": "258:36:22", "symbolAliases": [], "unitAlias": "" }, { "baseContracts": [ { "arguments": null, "baseName": { "contractScope": null, "id": 6626, "name": "DSMath", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 303, "src": "393:6:22", "typeDescriptions": { "typeIdentifier": "t_contract$_DSMath_$303", "typeString": "contract DSMath" } }, "id": 6627, "nodeType": "InheritanceSpecifier", "src": "393:6:22" } ], "contractDependencies": [ 303 ], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "id": 6760, "linearizedBaseContracts": [ 6760, 303 ], "name": "ContributionCalculation", "nodeType": "ContractDefinition", "nodes": [ { "id": 6630, "libraryName": { "contractScope": null, "id": 6628, "name": "SafeMath", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 21308, "src": "412:8:22", "typeDescriptions": { "typeIdentifier": "t_contract$_SafeMath_$21308", "typeString": "library SafeMath" } }, "nodeType": "UsingForDirective", "src": "406:27:22", "typeName": { "id": 6629, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "425:7:22", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } }, { "constant": false, "id": 6632, "name": "avatar", "nodeType": "VariableDeclaration", "scope": 6760, "src": "439:13:22", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_contract$_Avatar_$12705", "typeString": "contract Avatar" }, "typeName": { "contractScope": null, "id": 6631, "name": "Avatar", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 12705, "src": "439:6:22", "typeDescriptions": { "typeIdentifier": "t_contract$_Avatar_$12705", "typeString": "contract Avatar" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 6634, "name": "sellContributionRatio", "nodeType": "VariableDeclaration", "scope": 6760, "src": "550:36:22", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 6633, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "550:7:22", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "public" }, { "anonymous": false, "documentation": null, "id": 6642, "name": "SellContributionRatioUpdated", "nodeType": "EventDefinition", "parameters": { "id": 6641, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 6636, "indexed": true, "name": "caller", "nodeType": "VariableDeclaration", "scope": 6642, "src": "689:22:22", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 6635, "name": "address", "nodeType": "ElementaryTypeName", "src": "689:7:22", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 6638, "indexed": false, "name": "nom", "nodeType": "VariableDeclaration", "scope": 6642, "src": "721:11:22", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 6637, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "721:7:22", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 6640, "indexed": false, "name": "denom", "nodeType": "VariableDeclaration", "scope": 6642, "src": "742:13:22", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 6639, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "742:7:22", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "679:82:22" }, "src": "645:117:22" }, { "body": { "id": 6655, "nodeType": "Block", "src": "849:102:22", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_address_payable", "typeString": "address payable" }, "id": 6650, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 6646, "name": "avatar", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6632, "src": "875:6:22", "typeDescriptions": { "typeIdentifier": "t_contract$_Avatar_$12705", "typeString": "contract Avatar" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_contract$_Avatar_$12705", "typeString": "contract Avatar" } ], "id": 6645, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "867:7:22", "typeDescriptions": { "typeIdentifier": "t_type$_t_address_$", "typeString": "type(address)" }, "typeName": "address" }, "id": 6647, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "867:15:22", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 6648, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 22171, "src": "886:3:22", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 6649, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "886:10:22", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } }, "src": "867:29:22", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "argumentTypes": null, "hexValue": "6f6e6c79204176617461722063616e2063616c6c2074686973206d6574686f64", "id": 6651, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "898:34:22", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_ee04e2bb38b35a6a340a8c366b091fffa78170bc841c55c17c0389da4e8fb71a", "typeString": "literal_string \"only Avatar can call this method\"" }, "value": "only Avatar can call this method" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_stringliteral_ee04e2bb38b35a6a340a8c366b091fffa78170bc841c55c17c0389da4e8fb71a", "typeString": "literal_string \"only Avatar can call this method\"" } ], "id": 6644, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 22174, 22175 ], "referencedDeclaration": 22175, "src": "859:7:22", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 6652, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "859:74:22", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 6653, "nodeType": "ExpressionStatement", "src": "859:74:22" }, { "id": 6654, "nodeType": "PlaceholderStatement", "src": "943:1:22" } ] }, "documentation": "@dev modifier to check if caller is avatar", "id": 6656, "name": "onlyAvatar", "nodeType": "ModifierDefinition", "parameters": { "id": 6643, "nodeType": "ParameterList", "parameters": [], "src": "846:2:22" }, "src": "827:124:22", "visibility": "internal" }, { "body": { "id": 6676, "nodeType": "Block", "src": "1288:85:22", "statements": [ { "expression": { "argumentTypes": null, "id": 6670, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 6665, "name": "sellContributionRatio", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6634, "src": "1298:21:22", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 6667, "name": "_nom", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6660, "src": "1327:4:22", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, { "argumentTypes": null, "id": 6668, "name": "_denom", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6662, "src": "1333:6:22", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "expression": { "argumentTypes": [ { "typeIdent