UNPKG

arc_dx

Version:

A platform for building DAOs

664 lines (663 loc) 435 kB
{ "contractName": "Redeemer", "abi": [ { "constant": true, "inputs": [], "name": "contributionReward", "outputs": [ { "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "genesisProtocol", "outputs": [ { "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "inputs": [ { "name": "_contributionReward", "type": "address" }, { "name": "_genesisProtocol", "type": "address" } ], "payable": false, "stateMutability": "nonpayable", "type": "constructor" }, { "constant": false, "inputs": [ { "name": "_proposalId", "type": "bytes32" }, { "name": "_avatar", "type": "address" }, { "name": "_beneficiary", "type": "address" } ], "name": "redeem", "outputs": [ { "name": "gpRewards", "type": "uint256[5]" }, { "name": "gpDaoBountyReward", "type": "uint256[2]" }, { "name": "executed", "type": "bool" }, { "name": "winningVote", "type": "uint256" }, { "name": "crReputationReward", "type": "int256" }, { "name": "crNativeTokenReward", "type": "uint256" }, { "name": "crEthReward", "type": "uint256" }, { "name": "crExternalTokenReward", "type": "uint256" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" } ], "bytecode": "0x608060405234801561001057600080fd5b50604051604080610d4483398101604052805160209091015160008054600160a060020a03938416600160a060020a03199182161790915560018054939092169216919091179055610cdd806100676000396000f30060806040526004361061003d5763ffffffff60e060020a60003504166318db075081146100425780636be85df9146100735780637581d62f1461012f575b600080fd5b34801561004e57600080fd5b50610057610144565b60408051600160a060020a039092168252519081900360200190f35b34801561007f57600080fd5b5061009d600435600160a060020a0360243581169060443516610153565b604051808960a080838360005b838110156100c25781810151838201526020016100aa565b5050505090500188600260200280838360005b838110156100ed5781810151838201526020016100d5565b50505050905001871515151581526020018681526020018581526020018481526020018381526020018281526020019850505050505050505060405180910390f35b34801561013b57600080fd5b5061005761068d565b600054600160a060020a031681565b61015b610c58565b610163610c77565b600154604080517f61d585da000000000000000000000000000000000000000000000000000000008152600481018890529051600092839283928392839283928392600160a060020a0316916361d585da91602480830192602092919082900301818787803b1580156101d557600080fd5b505af11580156101e9573d6000803e3d6000fd5b505050506040513d60208110156101ff57600080fd5b50519050600381600581111561021157fe5b14806102285750600481600581111561022657fe5b145b8061023e5750600581600581111561023c57fe5b145b156102d957600154604080517fe751f271000000000000000000000000000000000000000000000000000000008152600481018f90529051600160a060020a039092169163e751f271916024808201926020929091908290030181600087803b1580156102aa57600080fd5b505af11580156102be573d6000803e3d6000fd5b505050506040513d60208110156102d457600080fd5b505196505b600154604080517f61d585da000000000000000000000000000000000000000000000000000000008152600481018f90529051600160a060020a03909216916361d585da916024808201926020929091908290030181600087803b15801561034057600080fd5b505af1158015610354573d6000803e3d6000fd5b505050506040513d602081101561036a57600080fd5b50519050600281600581111561037c57fe5b14806103935750600181600581111561039157fe5b145b1561067f57600154604080517fcc3bf9e9000000000000000000000000000000000000000000000000000000008152600481018f9052600160a060020a038d811660248301529151919092169163cc3bf9e99160448083019260a09291908290030181600087803b15801561040757600080fd5b505af115801561041b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525060a081101561044057600080fd5b81019080919050509850600160009054906101000a9004600160a060020a0316600160a060020a0316636359036b8d8c6040518363ffffffff1660e060020a02815260040180836000191660001916815260200182600160a060020a0316600160a060020a03168152602001925050506040805180830381600087803b1580156104c957600080fd5b505af11580156104dd573d6000803e3d6000fd5b505050506040513d60408110156104f357600080fd5b508051602090910151896000602002018a60016020020182815250828152505050600160009054906101000a9004600160a060020a0316600160a060020a0316633c1338188d6040518263ffffffff1660e060020a028152600401808260001916600019168152602001915050602060405180830381600087803b15801561057a57600080fd5b505af115801561058e573d6000803e3d6000fd5b505050506040513d60208110156105a457600080fd5b8101908080519060200190929190505050955060008060009054906101000a9004600160a060020a0316600160a060020a0316633a256daa8e8e6040518363ffffffff1660e060020a02815260040180836000191660001916815260200182600160a060020a0316600160a060020a0316815260200192505050602060405180830381600087803b15801561063857600080fd5b505af115801561064c573d6000803e3d6000fd5b505050506040513d602081101561066257600080fd5b5051111561067f576106748c8c61069c565b929750909550935091505b509397509397509397509397565b600154600160a060020a031681565b6000806000806106aa610c92565b600180825260208083019190915260008054604080517fe074ee55000000000000000000000000000000000000000000000000000000008152600481018c9052600160a060020a038b811660248301526002604483015291519394859485948594169263e074ee5592606480830193919282900301818787803b15801561073057600080fd5b505af1158015610744573d6000803e3d6000fd5b505050506040513d602081101561075a57600080fd5b810190808051906020019092919050505093506000809054906101000a9004600160a060020a0316600160a060020a0316636046f71d8c8c6040518363ffffffff1660e060020a02815260040180836000191660001916815260200182600160a060020a0316600160a060020a0316815260200192505050602060405180830381600087803b1580156107ec57600080fd5b505af1158015610800573d6000803e3d6000fd5b505050506040513d602081101561081657600080fd5b810190808051906020019092919050505092506000809054906101000a9004600160a060020a0316600160a060020a0316631c3a57138c8c6040518363ffffffff1660e060020a02815260040180836000191660001916815260200182600160a060020a0316600160a060020a0316815260200192505050602060405180830381600087803b1580156108a857600080fd5b505af11580156108bc573d6000803e3d6000fd5b505050506040513d60208110156108d257600080fd5b810190808051906020019092919050505091506000809054906101000a9004600160a060020a0316600160a060020a031663f70bbb9a8c8c6040518363ffffffff1660e060020a02815260040180836000191660001916815260200182600160a060020a0316600160a060020a0316815260200192505050602060405180830381600087803b15801561096457600080fd5b505af1158015610978573d6000803e3d6000fd5b505050506040513d602081101561098e57600080fd5b505190506109a2848463ffffffff610c2916565b92508215806109ba5750828a600160a060020a031631105b156109cb57600060408601526109d3565b600160408601525b60008054604080517fe074ee55000000000000000000000000000000000000000000000000000000008152600481018f9052600160a060020a038e81166024830152600360448301529151919092169263e074ee5592606480820193602093909283900390910190829087803b158015610a4c57600080fd5b505af1158015610a60573d6000803e3d6000fd5b505050506040513d6020811015610a7657600080fd5b50519350610a8a848363ffffffff610c2916565b9150811580610b1e57508181600160a060020a03166370a082318c6040518263ffffffff1660e060020a0281526004018082600160a060020a0316600160a060020a03168152602001915050602060405180830381600087803b158015610af057600080fd5b505af1158015610b04573d6000803e3d6000fd5b505050506040513d6020811015610b1a57600080fd5b5051105b15610b2f5760006060860152610b37565b600160608601525b600080546040517fd58bf09a000000000000000000000000000000000000000000000000000000008152600481018e8152600160a060020a038e811660248401529092169263d58bf09a928f928f928b92916044019083906080908190849084905b83811015610bb1578181015183820152602001610b99565b505050509050019350505050608060405180830381600087803b158015610bd757600080fd5b505af1158015610beb573d6000803e3d6000fd5b505050506040513d6080811015610c0157600080fd5b50805160208201516040830151606090930151919e909d50919b509950975050505050505050565b6000821515610c3a57506000610c52565b50818102818382811515610c4a57fe5b0414610c5257fe5b92915050565b60a0604051908101604052806005906020820280388339509192915050565b60408051808201825290600290829080388339509192915050565b60806040519081016040528060049060208202803883395091929150505600a165627a7a72305820cf8d79b9bde30e701cac0e89febc6d853758bdb47965a2672a2599ebf9048d120029", "deployedBytecode": "0x60806040526004361061003d5763ffffffff60e060020a60003504166318db075081146100425780636be85df9146100735780637581d62f1461012f575b600080fd5b34801561004e57600080fd5b50610057610144565b60408051600160a060020a039092168252519081900360200190f35b34801561007f57600080fd5b5061009d600435600160a060020a0360243581169060443516610153565b604051808960a080838360005b838110156100c25781810151838201526020016100aa565b5050505090500188600260200280838360005b838110156100ed5781810151838201526020016100d5565b50505050905001871515151581526020018681526020018581526020018481526020018381526020018281526020019850505050505050505060405180910390f35b34801561013b57600080fd5b5061005761068d565b600054600160a060020a031681565b61015b610c58565b610163610c77565b600154604080517f61d585da000000000000000000000000000000000000000000000000000000008152600481018890529051600092839283928392839283928392600160a060020a0316916361d585da91602480830192602092919082900301818787803b1580156101d557600080fd5b505af11580156101e9573d6000803e3d6000fd5b505050506040513d60208110156101ff57600080fd5b50519050600381600581111561021157fe5b14806102285750600481600581111561022657fe5b145b8061023e5750600581600581111561023c57fe5b145b156102d957600154604080517fe751f271000000000000000000000000000000000000000000000000000000008152600481018f90529051600160a060020a039092169163e751f271916024808201926020929091908290030181600087803b1580156102aa57600080fd5b505af11580156102be573d6000803e3d6000fd5b505050506040513d60208110156102d457600080fd5b505196505b600154604080517f61d585da000000000000000000000000000000000000000000000000000000008152600481018f90529051600160a060020a03909216916361d585da916024808201926020929091908290030181600087803b15801561034057600080fd5b505af1158015610354573d6000803e3d6000fd5b505050506040513d602081101561036a57600080fd5b50519050600281600581111561037c57fe5b14806103935750600181600581111561039157fe5b145b1561067f57600154604080517fcc3bf9e9000000000000000000000000000000000000000000000000000000008152600481018f9052600160a060020a038d811660248301529151919092169163cc3bf9e99160448083019260a09291908290030181600087803b15801561040757600080fd5b505af115801561041b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525060a081101561044057600080fd5b81019080919050509850600160009054906101000a9004600160a060020a0316600160a060020a0316636359036b8d8c6040518363ffffffff1660e060020a02815260040180836000191660001916815260200182600160a060020a0316600160a060020a03168152602001925050506040805180830381600087803b1580156104c957600080fd5b505af11580156104dd573d6000803e3d6000fd5b505050506040513d60408110156104f357600080fd5b508051602090910151896000602002018a60016020020182815250828152505050600160009054906101000a9004600160a060020a0316600160a060020a0316633c1338188d6040518263ffffffff1660e060020a028152600401808260001916600019168152602001915050602060405180830381600087803b15801561057a57600080fd5b505af115801561058e573d6000803e3d6000fd5b505050506040513d60208110156105a457600080fd5b8101908080519060200190929190505050955060008060009054906101000a9004600160a060020a0316600160a060020a0316633a256daa8e8e6040518363ffffffff1660e060020a02815260040180836000191660001916815260200182600160a060020a0316600160a060020a0316815260200192505050602060405180830381600087803b15801561063857600080fd5b505af115801561064c573d6000803e3d6000fd5b505050506040513d602081101561066257600080fd5b5051111561067f576106748c8c61069c565b929750909550935091505b509397509397509397509397565b600154600160a060020a031681565b6000806000806106aa610c92565b600180825260208083019190915260008054604080517fe074ee55000000000000000000000000000000000000000000000000000000008152600481018c9052600160a060020a038b811660248301526002604483015291519394859485948594169263e074ee5592606480830193919282900301818787803b15801561073057600080fd5b505af1158015610744573d6000803e3d6000fd5b505050506040513d602081101561075a57600080fd5b810190808051906020019092919050505093506000809054906101000a9004600160a060020a0316600160a060020a0316636046f71d8c8c6040518363ffffffff1660e060020a02815260040180836000191660001916815260200182600160a060020a0316600160a060020a0316815260200192505050602060405180830381600087803b1580156107ec57600080fd5b505af1158015610800573d6000803e3d6000fd5b505050506040513d602081101561081657600080fd5b810190808051906020019092919050505092506000809054906101000a9004600160a060020a0316600160a060020a0316631c3a57138c8c6040518363ffffffff1660e060020a02815260040180836000191660001916815260200182600160a060020a0316600160a060020a0316815260200192505050602060405180830381600087803b1580156108a857600080fd5b505af11580156108bc573d6000803e3d6000fd5b505050506040513d60208110156108d257600080fd5b810190808051906020019092919050505091506000809054906101000a9004600160a060020a0316600160a060020a031663f70bbb9a8c8c6040518363ffffffff1660e060020a02815260040180836000191660001916815260200182600160a060020a0316600160a060020a0316815260200192505050602060405180830381600087803b15801561096457600080fd5b505af1158015610978573d6000803e3d6000fd5b505050506040513d602081101561098e57600080fd5b505190506109a2848463ffffffff610c2916565b92508215806109ba5750828a600160a060020a031631105b156109cb57600060408601526109d3565b600160408601525b60008054604080517fe074ee55000000000000000000000000000000000000000000000000000000008152600481018f9052600160a060020a038e81166024830152600360448301529151919092169263e074ee5592606480820193602093909283900390910190829087803b158015610a4c57600080fd5b505af1158015610a60573d6000803e3d6000fd5b505050506040513d6020811015610a7657600080fd5b50519350610a8a848363ffffffff610c2916565b9150811580610b1e57508181600160a060020a03166370a082318c6040518263ffffffff1660e060020a0281526004018082600160a060020a0316600160a060020a03168152602001915050602060405180830381600087803b158015610af057600080fd5b505af1158015610b04573d6000803e3d6000fd5b505050506040513d6020811015610b1a57600080fd5b5051105b15610b2f5760006060860152610b37565b600160608601525b600080546040517fd58bf09a000000000000000000000000000000000000000000000000000000008152600481018e8152600160a060020a038e811660248401529092169263d58bf09a928f928f928b92916044019083906080908190849084905b83811015610bb1578181015183820152602001610b99565b505050509050019350505050608060405180830381600087803b158015610bd757600080fd5b505af1158015610beb573d6000803e3d6000fd5b505050506040513d6080811015610c0157600080fd5b50805160208201516040830151606090930151919e909d50919b509950975050505050505050565b6000821515610c3a57506000610c52565b50818102818382811515610c4a57fe5b0414610c5257fe5b92915050565b60a0604051908101604052806005906020820280388339509192915050565b60408051808201825290600290829080388339509192915050565b60806040519081016040528060049060208202803883395091929150505600a165627a7a72305820cf8d79b9bde30e701cac0e89febc6d853758bdb47965a2672a2599ebf9048d120029", "sourceMap": "152:5002:38:-;;;301:211;8:9:-1;5:2;;;30:1;27;20:12;5:2;301:211:38;;;;;;;;;;;;;;;;;;;384:18;:60;;-1:-1:-1;;;;;384:60:38;;;-1:-1:-1;;;;;;384:60:38;;;;;;;;454:51;;;;;;;;;;;;;;152:5002;;;;;;", "deployedSourceMap": "152:5002:38:-;;;;;;;;;-1:-1:-1;;;152:5002:38;;;;;;;;;;;;;;;;;;;;;;;206:44;;8:9:-1;5:2;;;30:1;27;20:12;5:2;206:44:38;;;;;;;;-1:-1:-1;;;;;206:44:38;;;;;;;;;;;;;;2217:1544;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;2217:1544:38;;;-1:-1:-1;;;;;2217:1544:38;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;2217:1544:38;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;2217:1544:38;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;256:38;;8:9:-1;5:2;;;30:1;27;20:12;5:2;256:38:38;;;;206:44;;;-1:-1:-1;;;;;206:44:38;;:::o;2217:1544::-;2316:17;;:::i;:::-;2347:25;;:::i;:::-;2628:15;;:34;;;;;;;;;;;;;;2386:13;;;;;;;;;;;;;;-1:-1:-1;;;;;2628:15:38;;:21;;:34;;;;;;;;;;;;;;2386:13;2628:15;:34;;;5:2:-1;;;;30:1;27;20:12;5:2;2628:34:38;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;2628:34:38;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;2628:34:38;;-1:-1:-1;2743:40:38;2733:6;:50;;;;;;;;;2732:116;;;-1:-1:-1;2810:37:38;2800:6;:47;;;;;;;;;2732:116;:190;;;-1:-1:-1;2874:47:38;2864:6;:57;;;;;;;;;2732:190;2728:268;;;2949:15;;:36;;;;;;;;;;;;;;-1:-1:-1;;;;;2949:15:38;;;;:23;;:36;;;;;;;;;;;;;;;:15;;:36;;;5:2:-1;;;;30:1;27;20:12;5:2;2949:36:38;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;2949:36:38;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;2949:36:38;;-1:-1:-1;2728:268:38;3014:15;;:34;;;;;;;;;;;;;;-1:-1:-1;;;;;3014:15:38;;;;:21;;:34;;;;;;;;;;;;;;;:15;;:34;;;5:2:-1;;;;30:1;27;20:12;5:2;3014:34:38;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;3014:34:38;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;3014:34:38;;-1:-1:-1;3073:38:38;3063:6;:48;;;;;;;;;3062:114;;;-1:-1:-1;3139:36:38;3129:6;:46;;;;;;;;;3062:114;3058:697;;;3204:15;;:48;;;;;;;;;;;;-1:-1:-1;;;;;3204:48:38;;;;;;;;;:15;;;;;:22;;:48;;;;;;;;;;;;;;:15;;:48;;;5:2:-1;;;;30:1;27;20:12;5:2;3204:48:38;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;3204:48:38;;;;;;;101:4:-1;97:9;90:4;84;80:15;76:31;69:5;65:43;126:6;120:4;113:20;0:138;13:3;8;5:12;2:2;;;30:1;27;20:12;2:2;3204:48:38;;;;;;;;3192:60;;3312:15;;;;;;;;;-1:-1:-1;;;;;3312:15:38;-1:-1:-1;;;;;3312:31:38;;3344:11;3356:12;3312:57;;;;;-1:-1:-1;;;3312:57:38;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;3312:57:38;-1:-1:-1;;;;;3312:57:38;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3312:57:38;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;3312:57:38;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;3312:57:38;;;;;;;3267:17;3285:1;3267:20;;;3288:17;3306:1;3288:20;;;3266:103;;;;;;;;;;3397:15;;;;;;;;;-1:-1:-1;;;;;3397:15:38;-1:-1:-1;;;;;3397:27:38;;3425:11;3397:40;;;;;-1:-1:-1;;;3397:40:38;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3397:40:38;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;3397:40:38;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;3397:40:38;;;;;;;;;;;;;;;;3383:54;;3587:1;3520:18;;;;;;;;;-1:-1:-1;;;;;3520:18:38;-1:-1:-1;;;;;3520:43:38;;3564:11;3576:7;3520:64;;;;;-1:-1:-1;;;3520:64:38;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;3520:64:38;-1:-1:-1;;;;;3520:64:38;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3520:64:38;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;3520:64:38;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;3520:64:38;:68;3516:229;;;3685:45;3710:11;3722:7;3685:24;:45::i;:::-;3608:122;;-1:-1:-1;3608:122:38;;-1:-1:-1;3608:122:38;-1:-1:-1;3608:122:38;-1:-1:-1;3516:229:38;2217:1544;;;;;;;;;;;;:::o;256:38::-;;;-1:-1:-1;;;;;256:38:38;;:::o;3767:1385::-;3863:14;3878:16;3895:8;3904:18;3938:27;;:::i;:::-;3993:4;3975:22;;;:15;4020;;;:22;;;;4066:17;4086:18;;:57;;;;;;;;;;;;-1:-1:-1;;;;;4086:57:38;;;;;;;4141:1;4086:57;;;;;;4066:17;;;;;;;;4086:18;;:34;;:57;;;;;3975:15;;4086:57;;;;;4066:17;4086:18;:57;;;5:2:-1;;;;30:1;27;20:12;5:2;4086:57:38;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;4086:57:38;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;4086:57:38;;;;;;;;;;;;;;;;4066:77;;4170:18;;;;;;;;;-1:-1:-1;;;;;4170:18:38;-1:-1:-1;;;;;4170:39:38;;4210:11;4222:7;4170:60;;;;;-1:-1:-1;;;4170:60:38;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;4170:60:38;-1:-1:-1;;;;;4170:60:38;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;4170:60:38;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;4170:60:38;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;4170:60:38;;;;;;;;;;;;;;;;4153:77;;4267:18;;;;;;;;;-1:-1:-1;;;;;4267:18:38;-1:-1:-1;;;;;4267:49:38;;4317:11;4329:7;4267:70;;;;;-1:-1:-1;;;4267:70:38;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;4267:70:38;-1:-1:-1;;;;;4267:70:38;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;4267:70:38;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;4267:70:38;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;4267:70:38;;;;;;;;;;;;;;;;4240:97;;4378:18;;;;;;;;;-1:-1:-1;;;;;4378:18:38;-1:-1:-1;;;;;4378:43:38;;4422:11;4434:7;4378:64;;;;;-1:-1:-1;;;4378:64:38;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;4378:64:38;-1:-1:-1;;;;;4378:64:38;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;4378:64:38;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;4378:64:38;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;4378:64:38;;-1:-1:-1;4464:27:38;:12;4481:9;4464:27;:16;:27;:::i;:::-;4452:39;-1:-1:-1;4506:14:38;;;4505:49;;;4544:9;4526:7;-1:-1:-1;;;;;4526:15:38;;:27;4505:49;4501:156;;;4588:5;4570:15;;;:23;4501:156;;;4642:4;4624:15;;;:22;4501:156;4681:18;;;:57;;;;;;;;;;;;-1:-1:-1;;;;;4681:57:38;;;;;;;4736:1;4681:57;;;;;;:18;;;;;:34;;:57;;;;;;;;;;;;;;;;;;:18;:57;;;5:2:-1;;;;30:1;27;20:12;5:2;4681:57:38;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;4681:57:38;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;4681:57:38;;-1:-1:-1;4770:37:38;4681:57;4787:19;4770:37;:16;:37;:::i;:::-;4748:59;-1:-1:-1;4822:24:38;;;4821:108;;;4909:19;4866:20;-1:-1:-1;;;;;4852:45:38;;4898:7;4852:54;;;;;-1:-1:-1;;;4852:54:38;;;;;;;-1:-1:-1;;;;;4852:54:38;-1:-1:-1;;;;;4852:54:38;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;4852:54:38;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;4852:54:38;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;4852:54:38;:76;4821:108;4817:215;;;4963:5;4945:15;;;:23;4817:215;;;5017:4;4999:15;;;:22;4817:215;5086:18;;;:59;;;;;;;;;;;-1:-1:-1;;;;;5086:59:38;;;;;;;:18;;;;:25;;5112:11;;5124:7;;5132:12;;5086:59;;;;5132:12;;5086:59;;;;;;5132:12;;8:100:-1;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;5086:59:38;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;5086:59:38;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;5086:59:38;;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;-1:-1;5086:59:38;;;;;;;;;;;;;;;;;;;-1:-1:-1;5086:59:38;;-1:-1:-1;5086:59:38;-1:-1:-1;3767:1385:38;-1:-1:-1;;;;;;;;3767:1385:38:o;203:380:54:-;263:9;489:7;;485:36;;;-1:-1:-1;513:1:54;506:8;;485:36;-1:-1:-1;531:7:54;;;536:2;531;:7;551:6;;;;;;;;:12;544:20;;;;203:380;;;;:::o;152:5002:38:-;;;;;;;;;;;;29:2:-1;21:6;17:15;117:4;105:10;97:6;88:34;-1:-1;152:5002:38;;;-1:-1:-1;;152:5002:38:o;:::-;;;;;;;;;;;;;;;105:10:-1;152:5002:38;88:34:-1;-1:-1;152:5002:38;;;-1:-1:-1;;152:5002:38:o;:::-;;;;;;;;;;;;29:2:-1;21:6;17:15;117:4;105:10;97:6;88:34;-1:-1;152:5002:38;;;-1:-1:-1;;152:5002:38:o", "source": "pragma solidity ^0.4.25;\n\nimport \"../universalSchemes/ContributionReward.sol\";\nimport \"@daostack/infra/contracts/votingMachines/GenesisProtocol.sol\";\n\n\ncontract Redeemer {\n using SafeMath for uint;\n\n ContributionReward public contributionReward;\n GenesisProtocol public genesisProtocol;\n\n constructor(address _contributionReward,address _genesisProtocol) public {\n contributionReward = ContributionReward(_contributionReward);\n genesisProtocol = GenesisProtocol(_genesisProtocol);\n }\n\n /**\n * @dev helper to redeem rewards for a proposal\n * It calls execute on the proposal if it is not yet executed.\n * It tries to redeem reputation and stake from the GenesisProtocol.\n * It tries to redeem proposal rewards from the contribution rewards scheme.\n * This function does not emit events.\n * A client should listen to GenesisProtocol and ContributionReward redemption events\n * to monitor redemption operations.\n * @param _proposalId the ID of the voting in the voting machine\n * @param _avatar address of the controller\n * @param _beneficiary beneficiary\n * @return gpRewards array\n * gpRewards[0] - stakerTokenAmount\n * gpRewards[1] - stakerReputationAmount\n * gpRewards[2] - voterTokenAmount\n * gpRewards[3] - voterReputationAmount\n * gpRewards[4] - proposerReputationAmount\n * @return gpDaoBountyReward array\n * gpDaoBountyReward[0] - staker dao bounty reward -\n * will be zero for the case there is not enough tokens in avatar for the reward.\n * gpDaoBountyReward[1] - staker potential dao bounty reward.\n * @return executed bool true or false\n * @return winningVote\n * 1 - executed or closed and the winning vote is YES\n * 2 - executed or closed and the winning vote is NO\n * @return int crReputationReward Reputation - from ContributionReward\n * @return int crNativeTokenReward NativeTokenReward - from ContributionReward\n * @return int crEthReward Ether - from ContributionReward\n * @return int crExternalTokenReward ExternalToken - from ContributionReward\n */\n function redeem(bytes32 _proposalId,address _avatar,address _beneficiary)\n external\n returns(uint[5] gpRewards,\n uint[2] gpDaoBountyReward,\n bool executed,\n uint winningVote,\n int crReputationReward,\n uint crNativeTokenReward,\n uint crEthReward,\n uint crExternalTokenReward)\n {\n GenesisProtocol.ProposalState pState = genesisProtocol.state(_proposalId);\n // solium-disable-next-line operator-whitespace\n if ((pState == GenesisProtocol.ProposalState.PreBoosted)||\n (pState == GenesisProtocol.ProposalState.Boosted)||\n (pState == GenesisProtocol.ProposalState.QuietEndingPeriod)) {\n executed = genesisProtocol.execute(_proposalId);\n }\n pState = genesisProtocol.state(_proposalId);\n if ((pState == GenesisProtocol.ProposalState.Executed) ||\n (pState == GenesisProtocol.ProposalState.Closed)) {\n gpRewards = genesisProtocol.redeem(_proposalId,_beneficiary);\n (gpDaoBountyReward[0],gpDaoBountyReward[1]) = genesisProtocol.redeemDaoBounty(_proposalId,_beneficiary);\n winningVote = genesisProtocol.winningVote(_proposalId);\n //redeem from contributionReward only if it executed\n if (contributionReward.getProposalExecutionTime(_proposalId,_avatar) > 0) {\n (crReputationReward,crNativeTokenReward,crEthReward,crExternalTokenReward) = contributionRewardRedeem(_proposalId,_avatar);\n }\n }\n }\n\n function contributionRewardRedeem(bytes32 _proposalId,address _avatar)\n private\n returns (int reputation,uint nativeToken,uint eth,uint externalToken)\n {\n bool[4] memory whatToRedeem;\n whatToRedeem[0] = true; //reputation\n whatToRedeem[1] = true; //nativeToken\n uint periodsToPay = contributionReward.getPeriodsToPay(_proposalId,_avatar,2);\n uint ethReward = contributionReward.getProposalEthReward(_proposalId,_avatar);\n uint externalTokenReward = contributionReward.getProposalExternalTokenReward(_proposalId,_avatar);\n address externalTokenAddress = contributionReward.getProposalExternalToken(_proposalId,_avatar);\n ethReward = periodsToPay.mul(ethReward);\n if ((ethReward == 0) || (_avatar.balance < ethReward)) {\n whatToRedeem[2] = false;\n } else {\n whatToRedeem[2] = true;\n }\n periodsToPay = contributionReward.getPeriodsToPay(_proposalId,_avatar,3);\n externalTokenReward = periodsToPay.mul(externalTokenReward);\n if ((externalTokenReward == 0) || (StandardToken(externalTokenAddress).balanceOf(_avatar) < externalTokenReward)) {\n whatToRedeem[3] = false;\n } else {\n whatToRedeem[3] = true;\n }\n (reputation,nativeToken,eth,externalToken) = contributionReward.redeem(_proposalId,_avatar,whatToRedeem);\n }\n}\n", "sourcePath": "/Users/oren/daostack/daostack2/daostack/contracts/utils/Redeemer.sol", "ast": { "absolutePath": "/Users/oren/daostack/daostack2/daostack/contracts/utils/Redeemer.sol", "exportedSymbols": { "Redeemer": [ 12696 ] }, "id": 12697, "nodeType": "SourceUnit", "nodes": [ { "id": 12370, "literals": [ "solidity", "^", "0.4", ".25" ], "nodeType": "PragmaDirective", "src": "0:24:38" }, { "absolutePath": "/Users/oren/daostack/daostack2/daostack/contracts/universalSchemes/ContributionReward.sol", "file": "../universalSchemes/ContributionReward.sol", "id": 12371, "nodeType": "ImportDirective", "scope": 12697, "sourceUnit": 8242, "src": "26:52:38", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "@daostack/infra/contracts/votingMachines/GenesisProtocol.sol", "file": "@daostack/infra/contracts/votingMachines/GenesisProtocol.sol", "id": 12372, "nodeType": "ImportDirective", "scope": 12697, "sourceUnit": 20209, "src": "79:70:38", "symbolAliases": [], "unitAlias": "" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "id": 12696, "linearizedBaseContracts": [ 12696 ], "name": "Redeemer", "nodeType": "ContractDefinition", "nodes": [ { "id": 12375, "libraryName": { "contractScope": null, "id": 12373, "name": "SafeMath", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 20791, "src": "182:8:38", "typeDescriptions": { "typeIdentifier": "t_contract$_SafeMath_$20791", "typeString": "library SafeMath" } }, "nodeType": "UsingForDirective", "src": "176:24:38", "typeName": { "id": 12374, "name": "uint", "nodeType": "ElementaryTypeName", "src": "195:4:38", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } }, { "constant": false, "id": 12377, "name": "contributionReward", "nodeType": "VariableDeclaration", "scope": 12696, "src": "206:44:38", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_contract$_ContributionReward_$8241", "typeString": "contract ContributionReward" }, "typeName": { "contractScope": null, "id": 12376, "name": "ContributionReward", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 8241, "src": "206:18:38", "typeDescriptions": { "typeIdentifier": "t_contract$_ContributionReward_$8241", "typeString": "contract ContributionReward" } }, "value": null, "visibility": "public" }, { "constant": false, "id": 12379, "name": "genesisProtocol", "nodeType": "VariableDeclaration", "scope": 12696, "src": "256:38:38", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_contract$_GenesisProtocol_$20208", "typeString": "contract GenesisProtocol" }, "typeName": { "contractScope": null, "id": 12378, "name": "GenesisProtocol", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 20208, "src": "256:15:38", "typeDescriptions": { "typeIdentifier": "t_contract$_GenesisProtocol_$20208", "typeString": "contract GenesisProtocol" } }, "value": null, "visibility": "public" }, { "body": { "id": 12398, "nodeType": "Block", "src": "374:138:38", "statements": [ { "expression": { "argumentTypes": null, "id": 12390, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 12386, "name": "contributionReward", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 12377, "src": "384:18:38", "typeDescriptions": { "typeIdentifier": "t_contract$_ContributionReward_$8241", "typeString": "contract ContributionReward" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 12388, "name": "_contributionReward", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 12381, "src": "424:19:38", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" } ], "id": 12387, "name": "ContributionReward", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 8241, "src": "405:18:38", "typeDescriptions": { "typeIdentifier": "t_type$_t_contract$_ContributionReward_$8241_$", "typeString": "type(contract ContributionReward)" } }, "id": 12389, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "405:39:38", "typeDescriptions": { "typeIdentifier": "t_contract$_ContributionReward_$8241", "typeString": "contract ContributionReward" } }, "src": "384:60:38", "typeDescriptions": { "typeIdentifier": "t_contract$_ContributionReward_$8241", "typeString": "contract ContributionReward" } }, "id": 12391, "nodeType": "ExpressionStatement", "src": "384:60:38" }, { "expression": { "argumentTypes": null, "id": 12396, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 12392, "name": "genesisProtocol", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 12379, "src": "454:15:38", "typeDescriptions": { "typeIdentifier": "t_contract$_GenesisProtocol_$20208", "typeString": "contract GenesisProtocol" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 12394, "name": "_genesisProtocol", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 12383, "src": "488:16:38", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" } ], "id": 12393, "name": "GenesisProtocol", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 20208, "src": "472:15:38", "typeDescriptions": { "typeIdentifier": "t_type$_t_contract$_GenesisProtocol_$20208_$", "typeString": "type(contract GenesisProtocol)" } }, "id": 12395, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "472:33:38", "typeDescriptions": { "typeIdentifier": "t_contract$_GenesisProtocol_$20208", "typeString": "contract GenesisProtocol" } }, "src": "454:51:38", "typeDescriptions": { "typeIdentifier": "t_contract$_GenesisProtocol_$20208", "typeString": "contract GenesisProtocol" } }, "id": 12397, "nodeType": "ExpressionStatement", "src": "454:51:38" } ] }, "documentation": null, "id": 12399, "implemented": true, "isConstructor": true, "isDeclaredConst": false, "modifiers": [], "name": "", "nodeType": "FunctionDefinition", "parameters": { "id": 12384, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 12381, "name": "_contributionReward", "nodeType": "VariableDeclaration", "scope": 12399, "src": "313:27:38", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 12380, "name": "address", "nodeType": "ElementaryTypeName", "src": "313:7:38", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 12383, "name": "_genesisProtocol", "nodeType": "VariableDeclaration", "scope": 12399, "src": "341:24:38", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 12382, "name": "address", "nodeType": "ElementaryTypeName", "src": "341:7:38", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "312:54:38" }, "payable": false, "returnParameters": { "id": 12385, "nodeType": "ParameterList", "parameters": [], "src": "374:0:38" }, "scope": 12696, "src": "301:211:38", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" }, { "body": { "id": 12537, "nodeType": "Block", "src": "2579:1182:38", "statements": [ { "assignments": [ 12431 ], "declarations": [ { "constant": false, "id": 12431, "name": "pState", "nodeType": "VariableDeclaration", "scope": 12538, "src": "2589:36:38", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_enum$_ProposalState_$17302", "typeString": "enum GenesisProtocol.ProposalState" }, "typeName": { "contractScope": null, "id": 12430, "name": "GenesisProtocol.ProposalState", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 17302, "src": "2589:29:38", "typeDescriptions": { "typeIdentifier": "t_enum$_ProposalState_$17302", "typeString": "enum GenesisProtocol.ProposalState" } }, "value": null, "visibility": "internal" } ], "id": 12436, "initialValue": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 12434, "name": "_proposalId", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 12401, "src": "2650:11:38", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } ], "expression": { "argumentTypes": null, "id": 12432, "name": "genesisProtocol", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 12379, "src": "2628:15:38", "typeDescriptions": { "typeIdentifier": "t_contract$_GenesisProtocol_$20208", "typeString": "contract GenesisProtocol" } }, "id": 12433, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "state", "nodeType": "MemberAccess", "referencedDeclaration": 18203, "src": "2628:21:38", "typeDescriptions": { "typeIdentifier": "t_function_external_view$_t_bytes32_$returns$_t_enum$_ProposalState_$17302_$", "typeString": "function (bytes32) view external returns (enum GenesisProtocol.ProposalState)" } }, "id": 12435, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2628:34:38", "typeDescriptions": { "typeIdentifier": "t_enum$_ProposalState_$17302", "typeString": "enum GenesisProtocol.ProposalState" } }, "nodeType": "VariableDeclarationStatement", "src": "2589:73:38" }, { "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_bool", "typeString": "bool" }, "id": 12456, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_bool", "typeString": "bool" }, "id": 12449, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "components": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_enum$_ProposalState_$17302", "typeString": "enum GenesisProtocol.ProposalState" }, "id": 12441, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 12437, "name": "pState", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 12431, "src": "2733:6:38", "typeDescriptions": { "typeIdentifier": "t_enum$_ProposalState_$17302", "typeString": "enum GenesisProtocol.ProposalState" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "argumentTypes": null, "expression": {