Contract 0xd5524179cB7AE012f5B642C1D6D700Bbaa76B96b 5

Augur 
 
 
Txn Hash
Method
Block
From
To
Value
0x9c5509bc97220b8ab9a1807f41b6d5e6e0e760fdbf063bd1fb2058961d246a0cApprove160566582022-11-26 20:51:111 day 21 hrs ago0x0ab7b5510179eecac9f0f90b64e70c34a800050e IN  Augur: Delegator0 Ether0.0004453912
0xee3804cc4e5e9edb21965428d81f718a1483dbd91e928094e51c9b6317a6f85fApprove159976802022-11-18 15:04:5910 days 3 hrs agoMirror: Jamie Dubs IN  Augur: Delegator0 Ether0.00089138 24.01625001
0x058f33eb3a40224821b1b5741f805daef03e4e445eff9ca9e7e391c267a6075dApprove156467282022-09-30 14:23:5959 days 4 hrs ago0x862244eeca0c73925b5a4daa14815fb81f499c93 IN  Augur: Delegator0 Ether0.00058829 15.85008289
0x104e53dcfd5c9cec37bb3de66c72871e4e37b00c6194337a137e5db19c5d1028Approve154027152022-08-24 11:40:5196 days 6 hrs ago0x27db2659ec702340244fd21edc02cc876bc7efac IN  Augur: Delegator0 Ether0.00018777 5.05904342
0x702f4d53bb019d93aea0e0e444b1d0373958cf186ddb64f2678078f6d0d6345cApprove151571022022-07-17 1:03:36134 days 17 hrs agoENS Name raditz.eth IN  Augur: Delegator0 Ether0.00052582 14.16700981
0x20bdbf7aef82a75614e048af6172564014e719edcf2b18f872abfe4248546f1fApprove150987562022-07-08 0:45:18143 days 17 hrs ago0xa4880d0e4268513482ba2709569fe69e58954f10 IN  Augur: Delegator0 Ether0.00097216 26.1927274
0x21f3055d340bc1330a17cd77f3050f4ed1c82e2fb5b1217f56a6f86bcc9afb9eApprove148801852022-05-31 18:11:27181 days 21 mins ago0x0276dece5594a6db72e044c85488519a18f9e462 IN  Augur: Delegator0 Ether0.00191855 51.69084387
0xa6906870d12a5788d9cd0ca5df3bbea5e153833d8a5a0972ccdee1a8cdf286cbApprove142589102022-02-22 23:39:33278 days 18 hrs agoENS Name fedepo.eth IN  Augur: Delegator0 Ether0.00354971 95.6383989
0x0f4273570b21279b505199395d8cd15cee0cd66b7cf47523dbb4f30a7e97de5dApprove142433452022-02-20 14:05:40281 days 4 hrs ago0x30f1fa85b90ed03267cc7e0c79c3816db2b18a7f IN  Augur: Delegator0 Ether0.00259959 70.03984296
0xd1e44e98867fe941cb03d2192c6c29c109fdeb7d6d94a5600ac3d555196a4c5aApprove142415262022-02-20 7:11:35281 days 11 hrs agoENS Name kevinkoo.eth IN  Augur: Delegator0 Ether0.00178661 48.13595913
0x29137bdb6791d4b3dbb6de05a55e81ae8eede3fb58edfa3b943fbcde19109ac8Approve142335232022-02-19 1:19:38282 days 17 hrs ago0xda13a236f498c82ef09d11c38d2733925441ee25 IN  Augur: Delegator0 Ether0.00236403 63.69319786
0xc813372fc31181315714d0816f41e1b821d1a37a2f4146ff12a3bd37f26f9d19Approve139409832022-01-04 19:59:10327 days 22 hrs ago0x946851681d16e2acf9df801cc86b0c1e8f8e23fa IN  Augur: Delegator0 Ether0.0050246 135.37562535
0xa11481e166649deecba6599201628da40677ba95b68fce7a2fa84ea3af790c48Approve139055532021-12-30 8:13:27333 days 10 hrs agoENS Name ethlawyer.eth IN  Augur: Delegator0 Ether0.00303973 81.89811744
0xdc5c9b4e9b2630365a0cd679ff66f65431f6cb8493ed5cd07832c601a99878ecApprove138760252021-12-25 18:40:09337 days 23 hrs agoENS Name writercami.eth IN  Augur: Delegator0 Ether0.00414386 105.93786381
0x2da5a3254682b10365113849ff412202c1fe24e1a59d0240413c2710a212dab3Approve138760252021-12-25 18:40:09337 days 23 hrs agoENS Name writercami.eth IN  Augur: Delegator0 Ether0.00302721 81.56080787
0xc15f53203b32e6be20398fea14698913dc737ffd4efc5016868aec9bb2b2923dApprove137794592021-12-10 19:55:35352 days 22 hrs ago0x483388c064fdcd036ad9df3807332023fb1cbbe7 IN  Augur: Delegator0 Ether0.00246076 66.29937873
0xc9296d8dfcabe3f3276d08ceeddfd3490c70a7e2da5b001ee12bc791b88d6c8aApprove132426822021-09-17 10:30:49437 days 8 hrs ago0xa1fd71f1d707f6191a1d6442aa3dac32495f71a6 IN  Augur: Delegator0 Ether0.00181784 48.97736154
0x4d0fcbfb9920bd64aa43df798917a3e106c944e303b693a70010bc1793ce86e3Approve125931842021-06-08 10:01:47538 days 8 hrs ago0x5e489aea57877c322dca7c126279f5b3457f37c6 IN  Augur: Delegator0 Ether0.00059410
0x72e4813f837348d1e5748b34f129c8cff3a1e36e67c1fd88c7bd7ba5b0828a22Approve122400892021-04-14 19:31:04592 days 23 hrs agoENS Name truecount.eth IN  Augur: Delegator0 Ether0.00252346123
0x8f8be3e980304318f9d45810ac50e526e2f36d87dde0257c615ecccb957fc68eApprove122196862021-04-11 16:19:43596 days 2 hrs ago0x3cc729e9cd6521e3e97cffc17a60005f1e78e5ac IN  Augur: Delegator0 Ether0.0018669591
0xfbc9940967b6e78a4b7bed0a06f9c3689f1ab45b77ea91ef49fd8d3536fe3017Approve120693142021-03-19 12:59:26619 days 5 hrs ago0x3a7db224acae17de7798797d82cdf8253017dfa8 IN  Augur: Delegator0 Ether0.00270811132
0xa52fdda4e81cd3cbf45df956ab0e21694c019eb6264e6e6f37750408647367e3Approve120692542021-03-19 12:46:51619 days 5 hrs ago0x000783970e93539003a25425e1f68e29103fac71 IN  Augur: Delegator0 Ether0.00260553127
0x6f542007d8bb667028ceb02015892cbd2f1e2af7e93d278fb89a737954d211f0Approve120562542021-03-17 12:46:36621 days 5 hrs ago0x260f180cfaa31e8a615545767461d4a0d72902e4 IN  Augur: Delegator0 Ether0.00315946154
0xc559d69cd9a8b7cd8ff3de2a0f500da377efa009ac7a97bc5d3fbad1103d098eApprove119480092021-02-28 20:36:34637 days 21 hrs ago0x38d6a550ebe865aca6938faaba0b34fcabb0d011 IN  Augur: Delegator0 Ether0.001538775
0xe9fc2c89ff6bb1ad2d3d8b47f482eb1b4a3a8373a0b182d4f8c91f1c40ed9dc9Approve119429392021-02-28 1:42:09638 days 16 hrs agoENS Name 563412.eth IN  Augur: Delegator0 Ether0.0017028283
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x75a7b2288cc9bcd96feba49460763c975938a15380dc993203c6cd19461e5331143559052022-03-10 0:33:06263 days 18 hrs ago Augur: Delegator0x02359349ba115b26fe715c18288c3f19dfe9f1cd0.19901846 Ether
0x923ad2aa5e753223aea99ba3572dfe2a8f8754531a12bf5f652e45e30401e596143559032022-03-10 0:32:49263 days 18 hrs ago Augur: Delegator0x02359349ba115b26fe715c18288c3f19dfe9f1cd0.19901846 Ether
0xb72528a2f1897b24ea9afe984871c04aa182f04392a0f1cc4c087be167ce6236143559012022-03-10 0:32:21263 days 18 hrs ago Augur: Delegator0x02359349ba115b26fe715c18288c3f19dfe9f1cd0.19901846 Ether
0x5314eeb6a39aaa9e34075875026dcdbc2b5480849df99e0bc5ec305088f50708143558972022-03-10 0:30:57263 days 18 hrs ago Augur: Delegator0x02359349ba115b26fe715c18288c3f19dfe9f1cd0.19901846 Ether
0x2d43d950cdc47a9920496f2cb1ed1d9a8f0abe9347df63eff909f737eb9d3929143545842022-03-09 19:55:29263 days 22 hrs ago Augur: Delegator0x02359349ba115b26fe715c18288c3f19dfe9f1cd0.19703846 Ether
0x4b08682a83efb2f0500183147f9ae15f969bedd6a974614787c75c86b39edf14143545092022-03-09 19:38:21263 days 22 hrs ago Augur: Delegator0x02359349ba115b26fe715c18288c3f19dfe9f1cd0.09851923 Ether
0xcb33751daf4e695952db0b28c9dff777f55d5991a2a8b4236c717eca39d23a9b137832342021-12-11 10:08:50352 days 8 hrs ago Augur: Delegator0x7ec1431c489ac12824f9b40af37dd60dde560ad80.686 Ether
0xc605649f88101965687b7fb05ce4500dff1f4a6a0b6b3cc076387f603c97c108134537942021-10-20 9:21:53404 days 9 hrs ago Augur: Delegator0x565c4b1054668e392483b6619e36bc3953f92a0e0.01 Ether
0xabdc481cea65fcf01ac47944f2ae9930fc87cff0c1c43a615dc7946ea732e785128053342021-07-11 9:57:42505 days 8 hrs ago 0x24e2b1d415e6e0d04042eaa45dc2a08fc33ca6cd Augur: Delegator0.46 Ether
0x663c66a0a5b53519a78849222c34f0e7f3a96dddf55ff4ddc2bbc8849d4960a7128045762021-07-11 7:04:03505 days 11 hrs ago Augur: Delegator0x43c28ff0175607c9563d404a187d3098fb4a0b1f4.62141398 Ether
0x85f57c00529a842edb7dbcfd1a2d3a9574c21344a575b967c0d609ae6dfedbe4128045392021-07-11 6:56:12505 days 11 hrs ago 0x24e2b1d415e6e0d04042eaa45dc2a08fc33ca6cd Augur: Delegator0.6532 Ether
0x2144b5098afc471f85985853e6d131a88784c3be170fff3f2e2845b2015d5c5f127089042021-06-26 9:33:17520 days 9 hrs ago Augur: Delegator0xbee1478aa0e827b8f509d9a5c2788d87616504201.96 Ether
0xd9b6798f08488a51068e08d514bf2c2d3f57e10e2848f7bdf929b12d2733d4c6127089042021-06-26 9:33:17520 days 9 hrs ago Augur: Delegator0x86bc0621239181858762210035eaf70da5eec3442.45608404 Ether
0x5e0e4b82ee2f7022dc635e2295eaae351e027ad202abb284fee3eaafb5a1a7d4127089032021-06-26 9:33:12520 days 9 hrs ago Augur: Delegator0xf40a6d7377fe4eff16ab3f7a9145c5655d8929860.98 Ether
0x8bb4ee978aa8a16ea45952767b9d72235031a72847ed89e362f5459747dc3c48127089032021-06-26 9:33:12520 days 9 hrs ago Augur: Delegator0xb1a90b91b9b868ea7953033169de30f6987fb6c50.98 Ether
0x630bd1658ba5b5780630f1723be3cc9ed34d63d73dcea35a2f5be8ffeb8b5065127089032021-06-26 9:33:12520 days 9 hrs ago Augur: Delegator0xf08a9de0a4d9218ff4c0e82fa9dc3ea6f25f25940.98 Ether
0x870557719a699433261dcae2d83172999c5588091e31cbb11aa38d92066d74b0127089032021-06-26 9:33:12520 days 9 hrs ago Augur: Delegator0xc8a92baa8c43f006e423546e19d55b9535b5e9730.98 Ether
0xab6d5bfe46434772071fa22ff849ef572eb6e7acb9e7ae4c726a1bb6d708823d127089032021-06-26 9:33:12520 days 9 hrs ago Augur: Delegator0x0423ce57e06b9299b2fac39152c6e37afc812fdb1.0117503 Ether
0xed42780ca7a0234b012b39ddb1345320d1a6a8756fb54c9328c38ad3380e0b87127089032021-06-26 9:33:12520 days 9 hrs ago Augur: Delegator0xa0af40e2d1e92760ac3ad52a883e9d4cccb42bac0.98 Ether
0xfcb35f4bc99103010e7e31c8b8cd2289dcbcd52e97f86fafa239a4d06a60625c127089032021-06-26 9:33:12520 days 9 hrs ago Augur: Delegator0xc3841afb98c05fcc83636d2bb17d4d923ab097390.97947368 Ether
0x875e105cf427276b32de1e0c98838a7217edbebb47cb27ae53e6550a72222d91127089032021-06-26 9:33:12520 days 9 hrs ago Augur: DelegatorENS Name eidgenosse.eth0.98 Ether
0x3647b64e16b3dcb60dee93ef3578623f12b0450d53a424984e0cfd2c163573af127089032021-06-26 9:33:12520 days 9 hrs ago Augur: Delegator0x31a689e7d62a6a5d59b8482f3556973c0fed7eca0.99 Ether
0x748980e19db4343aea765e8334478fb757fee42fc4d304a22b164b280a73ba5d127089032021-06-26 9:33:12520 days 9 hrs ago Augur: Delegator0xeaa829cd5a115fa19a8b67c8b9ed405ac93d5c570.97 Ether
0x1072ef0d16e45c35d4a3e13bbcb1b50c7ded9f57c327f0a3326b25ebd5ee4829127089032021-06-26 9:33:12520 days 9 hrs ago Augur: Delegator0xaa6a4d9e6c81d1f8d4eca26b3d969af8b5738d351.96 Ether
0x629e33fdb4df2470fff7bd3688c7bb78b9166547cc71af0fe3000bdc929ce8bf127089032021-06-26 9:33:12520 days 9 hrs ago Augur: Delegator0x4aecd37a8a314959fd48c39243361fee307dc4240.97982271 Ether
[ Download CSV Export 
Loading

Similar Match Source Code
Note: This contract matches the deployed ByteCode of the Source Code for Contract 0x10b5589fc6922f5c27061ac79ad9a4af35e15806

Contract Name:
Delegator

Compiler Version
v0.4.20+commit.3155dd80

Optimization Enabled:
Yes with 500 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity)

/**
 *Submitted for verification at Etherscan.io on 2018-07-08
*/

pragma solidity 0.4.20;

contract IAugur {
    function createChildUniverse(bytes32 _parentPayoutDistributionHash, uint256[] _parentPayoutNumerators, bool _parentInvalid) public returns (IUniverse);
    function isKnownUniverse(IUniverse _universe) public view returns (bool);
    function trustedTransfer(ERC20 _token, address _from, address _to, uint256 _amount) public returns (bool);
    function logMarketCreated(bytes32 _topic, string _description, string _extraInfo, IUniverse _universe, address _market, address _marketCreator, bytes32[] _outcomes, int256 _minPrice, int256 _maxPrice, IMarket.MarketType _marketType) public returns (bool);
    function logMarketCreated(bytes32 _topic, string _description, string _extraInfo, IUniverse _universe, address _market, address _marketCreator, int256 _minPrice, int256 _maxPrice, IMarket.MarketType _marketType) public returns (bool);
    function logInitialReportSubmitted(IUniverse _universe, address _reporter, address _market, uint256 _amountStaked, bool _isDesignatedReporter, uint256[] _payoutNumerators, bool _invalid) public returns (bool);
    function disputeCrowdsourcerCreated(IUniverse _universe, address _market, address _disputeCrowdsourcer, uint256[] _payoutNumerators, uint256 _size, bool _invalid) public returns (bool);
    function logDisputeCrowdsourcerContribution(IUniverse _universe, address _reporter, address _market, address _disputeCrowdsourcer, uint256 _amountStaked) public returns (bool);
    function logDisputeCrowdsourcerCompleted(IUniverse _universe, address _market, address _disputeCrowdsourcer) public returns (bool);
    function logInitialReporterRedeemed(IUniverse _universe, address _reporter, address _market, uint256 _amountRedeemed, uint256 _repReceived, uint256 _reportingFeesReceived, uint256[] _payoutNumerators) public returns (bool);
    function logDisputeCrowdsourcerRedeemed(IUniverse _universe, address _reporter, address _market, uint256 _amountRedeemed, uint256 _repReceived, uint256 _reportingFeesReceived, uint256[] _payoutNumerators) public returns (bool);
    function logFeeWindowRedeemed(IUniverse _universe, address _reporter, uint256 _amountRedeemed, uint256 _reportingFeesReceived) public returns (bool);
    function logMarketFinalized(IUniverse _universe) public returns (bool);
    function logMarketMigrated(IMarket _market, IUniverse _originalUniverse) public returns (bool);
    function logReportingParticipantDisavowed(IUniverse _universe, IMarket _market) public returns (bool);
    function logMarketParticipantsDisavowed(IUniverse _universe) public returns (bool);
    function logOrderCanceled(IUniverse _universe, address _shareToken, address _sender, bytes32 _orderId, Order.Types _orderType, uint256 _tokenRefund, uint256 _sharesRefund) public returns (bool);
    function logOrderCreated(Order.Types _orderType, uint256 _amount, uint256 _price, address _creator, uint256 _moneyEscrowed, uint256 _sharesEscrowed, bytes32 _tradeGroupId, bytes32 _orderId, IUniverse _universe, address _shareToken) public returns (bool);
    function logOrderFilled(IUniverse _universe, address _shareToken, address _filler, bytes32 _orderId, uint256 _numCreatorShares, uint256 _numCreatorTokens, uint256 _numFillerShares, uint256 _numFillerTokens, uint256 _marketCreatorFees, uint256 _reporterFees, uint256 _amountFilled, bytes32 _tradeGroupId) public returns (bool);
    function logCompleteSetsPurchased(IUniverse _universe, IMarket _market, address _account, uint256 _numCompleteSets) public returns (bool);
    function logCompleteSetsSold(IUniverse _universe, IMarket _market, address _account, uint256 _numCompleteSets) public returns (bool);
    function logTradingProceedsClaimed(IUniverse _universe, address _shareToken, address _sender, address _market, uint256 _numShares, uint256 _numPayoutTokens, uint256 _finalTokenBalance) public returns (bool);
    function logUniverseForked() public returns (bool);
    function logFeeWindowTransferred(IUniverse _universe, address _from, address _to, uint256 _value) public returns (bool);
    function logReputationTokensTransferred(IUniverse _universe, address _from, address _to, uint256 _value) public returns (bool);
    function logDisputeCrowdsourcerTokensTransferred(IUniverse _universe, address _from, address _to, uint256 _value) public returns (bool);
    function logShareTokensTransferred(IUniverse _universe, address _from, address _to, uint256 _value) public returns (bool);
    function logReputationTokenBurned(IUniverse _universe, address _target, uint256 _amount) public returns (bool);
    function logReputationTokenMinted(IUniverse _universe, address _target, uint256 _amount) public returns (bool);
    function logShareTokenBurned(IUniverse _universe, address _target, uint256 _amount) public returns (bool);
    function logShareTokenMinted(IUniverse _universe, address _target, uint256 _amount) public returns (bool);
    function logFeeWindowBurned(IUniverse _universe, address _target, uint256 _amount) public returns (bool);
    function logFeeWindowMinted(IUniverse _universe, address _target, uint256 _amount) public returns (bool);
    function logDisputeCrowdsourcerTokensBurned(IUniverse _universe, address _target, uint256 _amount) public returns (bool);
    function logDisputeCrowdsourcerTokensMinted(IUniverse _universe, address _target, uint256 _amount) public returns (bool);
    function logFeeWindowCreated(IFeeWindow _feeWindow, uint256 _id) public returns (bool);
    function logFeeTokenTransferred(IUniverse _universe, address _from, address _to, uint256 _value) public returns (bool);
    function logFeeTokenBurned(IUniverse _universe, address _target, uint256 _amount) public returns (bool);
    function logFeeTokenMinted(IUniverse _universe, address _target, uint256 _amount) public returns (bool);
    function logTimestampSet(uint256 _newTimestamp) public returns (bool);
    function logInitialReporterTransferred(IUniverse _universe, IMarket _market, address _from, address _to) public returns (bool);
    function logMarketTransferred(IUniverse _universe, address _from, address _to) public returns (bool);
    function logMarketMailboxTransferred(IUniverse _universe, IMarket _market, address _from, address _to) public returns (bool);
    function logEscapeHatchChanged(bool _isOn) public returns (bool);
}

contract IControlled {
    function getController() public view returns (IController);
    function setController(IController _controller) public returns(bool);
}

contract Controlled is IControlled {
    IController internal controller;

    modifier onlyWhitelistedCallers {
        require(controller.assertIsWhitelisted(msg.sender));
        _;
    }

    modifier onlyCaller(bytes32 _key) {
        require(msg.sender == controller.lookup(_key));
        _;
    }

    modifier onlyControllerCaller {
        require(IController(msg.sender) == controller);
        _;
    }

    modifier onlyInGoodTimes {
        require(controller.stopInEmergency());
        _;
    }

    modifier onlyInBadTimes {
        require(controller.onlyInEmergency());
        _;
    }

    function Controlled() public {
        controller = IController(msg.sender);
    }

    function getController() public view returns(IController) {
        return controller;
    }

    function setController(IController _controller) public onlyControllerCaller returns(bool) {
        controller = _controller;
        return true;
    }
}

contract IController {
    function assertIsWhitelisted(address _target) public view returns(bool);
    function lookup(bytes32 _key) public view returns(address);
    function stopInEmergency() public view returns(bool);
    function onlyInEmergency() public view returns(bool);
    function getAugur() public view returns (IAugur);
    function getTimestamp() public view returns (uint256);
}

contract DelegationTarget is Controlled {
    bytes32 public controllerLookupName;
}

contract Delegator is DelegationTarget {
    function Delegator(IController _controller, bytes32 _controllerLookupName) public {
        controller = _controller;
        controllerLookupName = _controllerLookupName;
    }

    function() external payable {
        // Do nothing if we haven't properly set up the delegator to delegate calls
        if (controllerLookupName == 0) {
            return;
        }

        // Get the delegation target contract
        address _target = controller.lookup(controllerLookupName);

        assembly {
            //0x40 is the address where the next free memory slot is stored in Solidity
            let _calldataMemoryOffset := mload(0x40)
            // new "memory end" including padding. The bitwise operations here ensure we get rounded up to the nearest 32 byte boundary
            let _size := and(add(calldatasize, 0x1f), not(0x1f))
            // Update the pointer at 0x40 to point at new free memory location so any theoretical allocation doesn't stomp our memory in this call
            mstore(0x40, add(_calldataMemoryOffset, _size))
            // Copy method signature and parameters of this call into memory
            calldatacopy(_calldataMemoryOffset, 0x0, calldatasize)
            // Call the actual method via delegation
            let _retval := delegatecall(gas, _target, _calldataMemoryOffset, calldatasize, 0, 0)
            switch _retval
            case 0 {
                // 0 == it threw, so we revert
                revert(0,0)
            } default {
                // If the call succeeded return the return data from the delegate call
                let _returndataMemoryOffset := mload(0x40)
                // Update the pointer at 0x40 again to point at new free memory location so any theoretical allocation doesn't stomp our memory in this call
                mstore(0x40, add(_returndataMemoryOffset, returndatasize))
                returndatacopy(_returndataMemoryOffset, 0x0, returndatasize)
                return(_returndataMemoryOffset, returndatasize)
            }
        }
    }
}

contract IOwnable {
    function getOwner() public view returns (address);
    function transferOwnership(address newOwner) public returns (bool);
}

contract ITyped {
    function getTypeName() public view returns (bytes32);
}

contract Initializable {
    bool private initialized = false;

    modifier afterInitialized {
        require(initialized);
        _;
    }

    modifier beforeInitialized {
        require(!initialized);
        _;
    }

    function endInitialization() internal beforeInitialized returns (bool) {
        initialized = true;
        return true;
    }

    function getInitialized() public view returns (bool) {
        return initialized;
    }
}

library SafeMathUint256 {
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a * b;
        require(a == 0 || c / a == b);
        return c;
    }

    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        // assert(b > 0); // Solidity automatically throws when dividing by 0
        uint256 c = a / b;
        // assert(a == b * c + a % b); // There is no case in which this doesn't hold
        return c;
    }

    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b <= a);
        return a - b;
    }

    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a);
        return c;
    }

    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        if (a <= b) {
            return a;
        } else {
            return b;
        }
    }

    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        if (a >= b) {
            return a;
        } else {
            return b;
        }
    }

    function getUint256Min() internal pure returns (uint256) {
        return 0;
    }

    function getUint256Max() internal pure returns (uint256) {
        return 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff;
    }

    function isMultipleOf(uint256 a, uint256 b) internal pure returns (bool) {
        return a % b == 0;
    }

    // Float [fixed point] Operations
    function fxpMul(uint256 a, uint256 b, uint256 base) internal pure returns (uint256) {
        return div(mul(a, b), base);
    }

    function fxpDiv(uint256 a, uint256 b, uint256 base) internal pure returns (uint256) {
        return div(mul(a, base), b);
    }
}

contract ERC20Basic {
    event Transfer(address indexed from, address indexed to, uint256 value);

    function balanceOf(address _who) public view returns (uint256);
    function transfer(address _to, uint256 _value) public returns (bool);
    function totalSupply() public view returns (uint256);
}

contract ERC20 is ERC20Basic {
    event Approval(address indexed owner, address indexed spender, uint256 value);

    function allowance(address _owner, address _spender) public view returns (uint256);
    function transferFrom(address _from, address _to, uint256 _value) public returns (bool);
    function approve(address _spender, uint256 _value) public returns (bool);
}

contract IFeeToken is ERC20, Initializable {
    function initialize(IFeeWindow _feeWindow) public returns (bool);
    function getFeeWindow() public view returns (IFeeWindow);
    function feeWindowBurn(address _target, uint256 _amount) public returns (bool);
    function mintForReportingParticipant(address _target, uint256 _amount) public returns (bool);
}

contract IFeeWindow is ITyped, ERC20 {
    function initialize(IUniverse _universe, uint256 _feeWindowId) public returns (bool);
    function getUniverse() public view returns (IUniverse);
    function getReputationToken() public view returns (IReputationToken);
    function getStartTime() public view returns (uint256);
    function getEndTime() public view returns (uint256);
    function getNumMarkets() public view returns (uint256);
    function getNumInvalidMarkets() public view returns (uint256);
    function getNumIncorrectDesignatedReportMarkets() public view returns (uint256);
    function getNumDesignatedReportNoShows() public view returns (uint256);
    function getFeeToken() public view returns (IFeeToken);
    function isActive() public view returns (bool);
    function isOver() public view returns (bool);
    function onMarketFinalized() public returns (bool);
    function buy(uint256 _attotokens) public returns (bool);
    function redeem(address _sender) public returns (bool);
    function redeemForReportingParticipant() public returns (bool);
    function mintFeeTokens(uint256 _amount) public returns (bool);
    function trustedUniverseBuy(address _buyer, uint256 _attotokens) public returns (bool);
}

contract IMailbox {
    function initialize(address _owner, IMarket _market) public returns (bool);
    function depositEther() public payable returns (bool);
}

contract IMarket is ITyped, IOwnable {
    enum MarketType {
        YES_NO,
        CATEGORICAL,
        SCALAR
    }

    function initialize(IUniverse _universe, uint256 _endTime, uint256 _feePerEthInAttoeth, ICash _cash, address _designatedReporterAddress, address _creator, uint256 _numOutcomes, uint256 _numTicks) public payable returns (bool _success);
    function derivePayoutDistributionHash(uint256[] _payoutNumerators, bool _invalid) public view returns (bytes32);
    function getUniverse() public view returns (IUniverse);
    function getFeeWindow() public view returns (IFeeWindow);
    function getNumberOfOutcomes() public view returns (uint256);
    function getNumTicks() public view returns (uint256);
    function getDenominationToken() public view returns (ICash);
    function getShareToken(uint256 _outcome)  public view returns (IShareToken);
    function getMarketCreatorSettlementFeeDivisor() public view returns (uint256);
    function getForkingMarket() public view returns (IMarket _market);
    function getEndTime() public view returns (uint256);
    function getMarketCreatorMailbox() public view returns (IMailbox);
    function getWinningPayoutDistributionHash() public view returns (bytes32);
    function getWinningPayoutNumerator(uint256 _outcome) public view returns (uint256);
    function getReputationToken() public view returns (IReputationToken);
    function getFinalizationTime() public view returns (uint256);
    function getInitialReporterAddress() public view returns (address);
    function deriveMarketCreatorFeeAmount(uint256 _amount) public view returns (uint256);
    function isContainerForShareToken(IShareToken _shadyTarget) public view returns (bool);
    function isContainerForReportingParticipant(IReportingParticipant _reportingParticipant) public view returns (bool);
    function isInvalid() public view returns (bool);
    function finalize() public returns (bool);
    function designatedReporterWasCorrect() public view returns (bool);
    function designatedReporterShowed() public view returns (bool);
    function isFinalized() public view returns (bool);
    function finalizeFork() public returns (bool);
    function assertBalances() public view returns (bool);
}

contract IReportingParticipant {
    function getStake() public view returns (uint256);
    function getPayoutDistributionHash() public view returns (bytes32);
    function liquidateLosing() public returns (bool);
    function redeem(address _redeemer) public returns (bool);
    function isInvalid() public view returns (bool);
    function isDisavowed() public view returns (bool);
    function migrate() public returns (bool);
    function getPayoutNumerator(uint256 _outcome) public view returns (uint256);
    function getMarket() public view returns (IMarket);
    function getSize() public view returns (uint256);
}

contract IDisputeCrowdsourcer is IReportingParticipant, ERC20 {
    function initialize(IMarket market, uint256 _size, bytes32 _payoutDistributionHash, uint256[] _payoutNumerators, bool _invalid) public returns (bool);
    function contribute(address _participant, uint256 _amount) public returns (uint256);
}

contract IReputationToken is ITyped, ERC20 {
    function initialize(IUniverse _universe) public returns (bool);
    function migrateOut(IReputationToken _destination, uint256 _attotokens) public returns (bool);
    function migrateIn(address _reporter, uint256 _attotokens) public returns (bool);
    function trustedReportingParticipantTransfer(address _source, address _destination, uint256 _attotokens) public returns (bool);
    function trustedMarketTransfer(address _source, address _destination, uint256 _attotokens) public returns (bool);
    function trustedFeeWindowTransfer(address _source, address _destination, uint256 _attotokens) public returns (bool);
    function trustedUniverseTransfer(address _source, address _destination, uint256 _attotokens) public returns (bool);
    function getUniverse() public view returns (IUniverse);
    function getTotalMigrated() public view returns (uint256);
    function getTotalTheoreticalSupply() public view returns (uint256);
    function mintForReportingParticipant(uint256 _amountMigrated) public returns (bool);
}

contract IUniverse is ITyped {
    function initialize(IUniverse _parentUniverse, bytes32 _parentPayoutDistributionHash) external returns (bool);
    function fork() public returns (bool);
    function getParentUniverse() public view returns (IUniverse);
    function createChildUniverse(uint256[] _parentPayoutNumerators, bool _invalid) public returns (IUniverse);
    function getChildUniverse(bytes32 _parentPayoutDistributionHash) public view returns (IUniverse);
    function getReputationToken() public view returns (IReputationToken);
    function getForkingMarket() public view returns (IMarket);
    function getForkEndTime() public view returns (uint256);
    function getForkReputationGoal() public view returns (uint256);
    function getParentPayoutDistributionHash() public view returns (bytes32);
    function getDisputeRoundDurationInSeconds() public view returns (uint256);
    function getOrCreateFeeWindowByTimestamp(uint256 _timestamp) public returns (IFeeWindow);
    function getOrCreateCurrentFeeWindow() public returns (IFeeWindow);
    function getOrCreateNextFeeWindow() public returns (IFeeWindow);
    function getOpenInterestInAttoEth() public view returns (uint256);
    function getRepMarketCapInAttoeth() public view returns (uint256);
    function getTargetRepMarketCapInAttoeth() public view returns (uint256);
    function getOrCacheValidityBond() public returns (uint256);
    function getOrCacheDesignatedReportStake() public returns (uint256);
    function getOrCacheDesignatedReportNoShowBond() public returns (uint256);
    function getOrCacheReportingFeeDivisor() public returns (uint256);
    function getDisputeThresholdForFork() public view returns (uint256);
    function getInitialReportMinValue() public view returns (uint256);
    function calculateFloatingValue(uint256 _badMarkets, uint256 _totalMarkets, uint256 _targetDivisor, uint256 _previousValue, uint256 _defaultValue, uint256 _floor) public pure returns (uint256 _newValue);
    function getOrCacheMarketCreationCost() public returns (uint256);
    function getCurrentFeeWindow() public view returns (IFeeWindow);
    function getOrCreateFeeWindowBefore(IFeeWindow _feeWindow) public returns (IFeeWindow);
    function isParentOf(IUniverse _shadyChild) public view returns (bool);
    function updateTentativeWinningChildUniverse(bytes32 _parentPayoutDistributionHash) public returns (bool);
    function isContainerForFeeWindow(IFeeWindow _shadyTarget) public view returns (bool);
    function isContainerForMarket(IMarket _shadyTarget) public view returns (bool);
    function isContainerForReportingParticipant(IReportingParticipant _reportingParticipant) public view returns (bool);
    function isContainerForShareToken(IShareToken _shadyTarget) public view returns (bool);
    function isContainerForFeeToken(IFeeToken _shadyTarget) public view returns (bool);
    function addMarketTo() public returns (bool);
    function removeMarketFrom() public returns (bool);
    function decrementOpenInterest(uint256 _amount) public returns (bool);
    function decrementOpenInterestFromMarket(uint256 _amount) public returns (bool);
    function incrementOpenInterest(uint256 _amount) public returns (bool);
    function incrementOpenInterestFromMarket(uint256 _amount) public returns (bool);
    function getWinningChildUniverse() public view returns (IUniverse);
    function isForking() public view returns (bool);
}

contract ICash is ERC20 {
    function depositEther() external payable returns(bool);
    function depositEtherFor(address _to) external payable returns(bool);
    function withdrawEther(uint256 _amount) external returns(bool);
    function withdrawEtherTo(address _to, uint256 _amount) external returns(bool);
    function withdrawEtherToIfPossible(address _to, uint256 _amount) external returns (bool);
}

contract IOrders {
    function saveOrder(Order.Types _type, IMarket _market, uint256 _fxpAmount, uint256 _price, address _sender, uint256 _outcome, uint256 _moneyEscrowed, uint256 _sharesEscrowed, bytes32 _betterOrderId, bytes32 _worseOrderId, bytes32 _tradeGroupId) public returns (bytes32 _orderId);
    function removeOrder(bytes32 _orderId) public returns (bool);
    function getMarket(bytes32 _orderId) public view returns (IMarket);
    function getOrderType(bytes32 _orderId) public view returns (Order.Types);
    function getOutcome(bytes32 _orderId) public view returns (uint256);
    function getAmount(bytes32 _orderId) public view returns (uint256);
    function getPrice(bytes32 _orderId) public view returns (uint256);
    function getOrderCreator(bytes32 _orderId) public view returns (address);
    function getOrderSharesEscrowed(bytes32 _orderId) public view returns (uint256);
    function getOrderMoneyEscrowed(bytes32 _orderId) public view returns (uint256);
    function getBetterOrderId(bytes32 _orderId) public view returns (bytes32);
    function getWorseOrderId(bytes32 _orderId) public view returns (bytes32);
    function getBestOrderId(Order.Types _type, IMarket _market, uint256 _outcome) public view returns (bytes32);
    function getWorstOrderId(Order.Types _type, IMarket _market, uint256 _outcome) public view returns (bytes32);
    function getLastOutcomePrice(IMarket _market, uint256 _outcome) public view returns (uint256);
    function getOrderId(Order.Types _type, IMarket _market, uint256 _fxpAmount, uint256 _price, address _sender, uint256 _blockNumber, uint256 _outcome, uint256 _moneyEscrowed, uint256 _sharesEscrowed) public pure returns (bytes32);
    function getTotalEscrowed(IMarket _market) public view returns (uint256);
    function isBetterPrice(Order.Types _type, uint256 _price, bytes32 _orderId) public view returns (bool);
    function isWorsePrice(Order.Types _type, uint256 _price, bytes32 _orderId) public view returns (bool);
    function assertIsNotBetterPrice(Order.Types _type, uint256 _price, bytes32 _betterOrderId) public view returns (bool);
    function assertIsNotWorsePrice(Order.Types _type, uint256 _price, bytes32 _worseOrderId) public returns (bool);
    function recordFillOrder(bytes32 _orderId, uint256 _sharesFilled, uint256 _tokensFilled) public returns (bool);
    function setPrice(IMarket _market, uint256 _outcome, uint256 _price) external returns (bool);
    function incrementTotalEscrowed(IMarket _market, uint256 _amount) external returns (bool);
    function decrementTotalEscrowed(IMarket _market, uint256 _amount) external returns (bool);
}

contract IShareToken is ITyped, ERC20 {
    function initialize(IMarket _market, uint256 _outcome) external returns (bool);
    function createShares(address _owner, uint256 _amount) external returns (bool);
    function destroyShares(address, uint256 balance) external returns (bool);
    function getMarket() external view returns (IMarket);
    function getOutcome() external view returns (uint256);
    function trustedOrderTransfer(address _source, address _destination, uint256 _attotokens) public returns (bool);
    function trustedFillOrderTransfer(address _source, address _destination, uint256 _attotokens) public returns (bool);
    function trustedCancelOrderTransfer(address _source, address _destination, uint256 _attotokens) public returns (bool);
}

library Order {
    using SafeMathUint256 for uint256;

    enum Types {
        Bid, Ask
    }

    enum TradeDirections {
        Long, Short
    }

    struct Data {
        // Contracts
        IOrders orders;
        IMarket market;
        IAugur augur;

        // Order
        bytes32 id;
        address creator;
        uint256 outcome;
        Order.Types orderType;
        uint256 amount;
        uint256 price;
        uint256 sharesEscrowed;
        uint256 moneyEscrowed;
        bytes32 betterOrderId;
        bytes32 worseOrderId;
    }

    //
    // Constructor
    //

    // No validation is needed here as it is simply a librarty function for organizing data
    function create(IController _controller, address _creator, uint256 _outcome, Order.Types _type, uint256 _attoshares, uint256 _price, IMarket _market, bytes32 _betterOrderId, bytes32 _worseOrderId) internal view returns (Data) {
        require(_outcome < _market.getNumberOfOutcomes());
        require(_price < _market.getNumTicks());

        IOrders _orders = IOrders(_controller.lookup("Orders"));
        IAugur _augur = _controller.getAugur();

        return Data({
            orders: _orders,
            market: _market,
            augur: _augur,
            id: 0,
            creator: _creator,
            outcome: _outcome,
            orderType: _type,
            amount: _attoshares,
            price: _price,
            sharesEscrowed: 0,
            moneyEscrowed: 0,
            betterOrderId: _betterOrderId,
            worseOrderId: _worseOrderId
        });
    }

    //
    // "public" functions
    //

    function getOrderId(Order.Data _orderData) internal view returns (bytes32) {
        if (_orderData.id == bytes32(0)) {
            bytes32 _orderId = _orderData.orders.getOrderId(_orderData.orderType, _orderData.market, _orderData.amount, _orderData.price, _orderData.creator, block.number, _orderData.outcome, _orderData.moneyEscrowed, _orderData.sharesEscrowed);
            require(_orderData.orders.getAmount(_orderId) == 0);
            _orderData.id = _orderId;
        }
        return _orderData.id;
    }

    function getOrderTradingTypeFromMakerDirection(Order.TradeDirections _creatorDirection) internal pure returns (Order.Types) {
        return (_creatorDirection == Order.TradeDirections.Long) ? Order.Types.Bid : Order.Types.Ask;
    }

    function getOrderTradingTypeFromFillerDirection(Order.TradeDirections _fillerDirection) internal pure returns (Order.Types) {
        return (_fillerDirection == Order.TradeDirections.Long) ? Order.Types.Ask : Order.Types.Bid;
    }

    function escrowFunds(Order.Data _orderData) internal returns (bool) {
        if (_orderData.orderType == Order.Types.Ask) {
            return escrowFundsForAsk(_orderData);
        } else if (_orderData.orderType == Order.Types.Bid) {
            return escrowFundsForBid(_orderData);
        }
    }

    function saveOrder(Order.Data _orderData, bytes32 _tradeGroupId) internal returns (bytes32) {
        return _orderData.orders.saveOrder(_orderData.orderType, _orderData.market, _orderData.amount, _orderData.price, _orderData.creator, _orderData.outcome, _orderData.moneyEscrowed, _orderData.sharesEscrowed, _orderData.betterOrderId, _orderData.worseOrderId, _tradeGroupId);
    }

    //
    // Private functions
    //

    function escrowFundsForBid(Order.Data _orderData) private returns (bool) {
        require(_orderData.moneyEscrowed == 0);
        require(_orderData.sharesEscrowed == 0);
        uint256 _attosharesToCover = _orderData.amount;
        uint256 _numberOfOutcomes = _orderData.market.getNumberOfOutcomes();

        // Figure out how many almost-complete-sets (just missing `outcome` share) the creator has
        uint256 _attosharesHeld = 2**254;
        for (uint256 _i = 0; _i < _numberOfOutcomes; _i++) {
            if (_i != _orderData.outcome) {
                uint256 _creatorShareTokenBalance = _orderData.market.getShareToken(_i).balanceOf(_orderData.creator);
                _attosharesHeld = SafeMathUint256.min(_creatorShareTokenBalance, _attosharesHeld);
            }
        }

        // Take shares into escrow if they have any almost-complete-sets
        if (_attosharesHeld > 0) {
            _orderData.sharesEscrowed = SafeMathUint256.min(_attosharesHeld, _attosharesToCover);
            _attosharesToCover -= _orderData.sharesEscrowed;
            for (_i = 0; _i < _numberOfOutcomes; _i++) {
                if (_i != _orderData.outcome) {
                    _orderData.market.getShareToken(_i).trustedOrderTransfer(_orderData.creator, _orderData.market, _orderData.sharesEscrowed);
                }
            }
        }
        // If not able to cover entire order with shares alone, then cover remaining with tokens
        if (_attosharesToCover > 0) {
            _orderData.moneyEscrowed = _attosharesToCover.mul(_orderData.price);
            require(_orderData.augur.trustedTransfer(_orderData.market.getDenominationToken(), _orderData.creator, _orderData.market, _orderData.moneyEscrowed));
        }

        return true;
    }

    function escrowFundsForAsk(Order.Data _orderData) private returns (bool) {
        require(_orderData.moneyEscrowed == 0);
        require(_orderData.sharesEscrowed == 0);
        IShareToken _shareToken = _orderData.market.getShareToken(_orderData.outcome);
        uint256 _attosharesToCover = _orderData.amount;

        // Figure out how many shares of the outcome the creator has
        uint256 _attosharesHeld = _shareToken.balanceOf(_orderData.creator);

        // Take shares in escrow if user has shares
        if (_attosharesHeld > 0) {
            _orderData.sharesEscrowed = SafeMathUint256.min(_attosharesHeld, _attosharesToCover);
            _attosharesToCover -= _orderData.sharesEscrowed;
            _shareToken.trustedOrderTransfer(_orderData.creator, _orderData.market, _orderData.sharesEscrowed);
        }

        // If not able to cover entire order with shares alone, then cover remaining with tokens
        if (_attosharesToCover > 0) {
            _orderData.moneyEscrowed = _orderData.market.getNumTicks().sub(_orderData.price).mul(_attosharesToCover);
            require(_orderData.augur.trustedTransfer(_orderData.market.getDenominationToken(), _orderData.creator, _orderData.market, _orderData.moneyEscrowed));
        }

        return true;
    }
}

Contract Security Audit

Contract ABI

[{"constant":true,"inputs":[],"name":"getController","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_controller","type":"address"}],"name":"setController","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"controllerLookupName","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"_controller","type":"address"},{"name":"_controllerLookupName","type":"bytes32"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"payable":true,"stateMutability":"payable","type":"fallback"}]

6060604052341561000f57600080fd5b6040516040806102fd833981016040528080519190602001805160008054600160a060020a039586163396909616600160a060020a03199182161716949094179093555050600155610297806100666000396000f3006060604052600436106100565763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416633018205f811461014057806392eefe9b1461017c578063bef72fa2146101bc575b60015460009015156100675761013d565b6000805460015473ffffffffffffffffffffffffffffffffffffffff9091169163f39ec1f79190604051602001526040517c010000000000000000000000000000000000000000000000000000000063ffffffff84160281526004810191909152602401602060405180830381600087803b15156100e457600080fd5b6102c65a03f115156100f557600080fd5b505050604051805190509050604051601f19601f36011680820160405236600083376000803684865af4808015610138576040513d81016040523d6000823e3d81f35b600080fd5b50005b341561014b57600080fd5b6101536101e1565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b341561018757600080fd5b6101a873ffffffffffffffffffffffffffffffffffffffff600435166101fd565b604051901515815260200160405180910390f35b34156101c757600080fd5b6101cf610265565b60405190815260200160405180910390f35b60005473ffffffffffffffffffffffffffffffffffffffff1690565b600080543373ffffffffffffffffffffffffffffffffffffffff90811691161461022657600080fd5b506000805473ffffffffffffffffffffffffffffffffffffffff831673ffffffffffffffffffffffffffffffffffffffff199091161790556001919050565b600154815600a165627a7a7230582084796531768a1d75b70a76b8cd7c7db53c078e5abbed437bd74b1419316ec5990029000000000000000000000000b3337164e91b9f05c87c7662c7ac684e8e0ff3e754726164696e6745736361706548617463685461726765740000000000000000

Swarm Source

bzzr://84796531768a1d75b70a76b8cd7c7db53c078e5abbed437bd74b1419316ec599
Block Transaction Difficulty Gas Used Reward
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.