Contract 0x366021610bf0d5ebfdc9041a7f8b152aa76e6d98

Contract Overview

Balance:
0 Ether
TxHash Block Age From To Value [TxFee]
0xd8ea067f374ff4007376977a7f65be8aeeca8ed06a6d695663ba2b9d613390aa1048576816 days 8 hrs ago0x942bbccde96bec073e1dcfc50bc661c21a674d63 IN  0x366021610bf0d5ebfdc9041a7f8b152aa76e6d980 Ether0.000024734
0xd42777f9dd20ec686594133141a11cdf1c5d78f9fa43f80d76ae39452784800d1048576216 days 8 hrs ago0xc33bdb8051d6d2002c0d80a1dd23a1c9d9fc26e4 IN  0x366021610bf0d5ebfdc9041a7f8b152aa76e6d980 Ether0.00004251
0x1b99d26bfe9d63e0f46c12a6126585b2801f1912e695e1b209639d3e91162e171048575316 days 8 hrs ago0x9677044a39550cebb01fa79bec04cf54e162d0c3 IN  0x366021610bf0d5ebfdc9041a7f8b152aa76e6d980 Ether0.000073721
0x26ce197cc719d750c401f666673c663cfc14568b11c69ba55139e957296dea4c1048574416 days 8 hrs ago0x9677044a39550cebb01fa79bec04cf54e162d0c3 IN  0x366021610bf0d5ebfdc9041a7f8b152aa76e6d980 Ether0.00006159
0xf3ed43c3e5cdbbda8f851d5a1fb18ff0821516a0db58e8a9c385456f9fce349c1033934238 days 3 hrs ago0x0a2926f2e2c9d60aebf5cfe0911fbdefce47db5e IN  0x366021610bf0d5ebfdc9041a7f8b152aa76e6d980 Ether0.00057316
0xb0a44d858e5efed127e20512ff507cf83234da434d08c32b51384b7aeb5480cc1033929938 days 3 hrs ago0xc33bdb8051d6d2002c0d80a1dd23a1c9d9fc26e4 IN  0x366021610bf0d5ebfdc9041a7f8b152aa76e6d980 Ether0.0008502
0x747e66f5e04f8dfc71c4e9c0515d08789df8026e1e32fb74a24d19907344eb2f1033929538 days 3 hrs ago0xea3f46c50ae211fe59107321a32af97f215df566 IN  0x366021610bf0d5ebfdc9041a7f8b152aa76e6d980 Ether0.00147314
0x9a8bebb83d1465ba2e6b5c66a700bd38264c6e8d713396a8de62ec6c343308521033927238 days 3 hrs ago0xea3f46c50ae211fe59107321a32af97f215df566 IN  0x366021610bf0d5ebfdc9041a7f8b152aa76e6d980 Ether0.00123308
0xe3993ab283038089a635a17f0663be0a603aa838b5fdd12497126e865e1bf3f71033768738 days 9 hrs ago0xea3f46c50ae211fe59107321a32af97f215df566 IN  0x366021610bf0d5ebfdc9041a7f8b152aa76e6d980 Ether0.000024734
0x81a2e6ee1e766bfbde2b027a12a25b8d6d2e1225da9ebd199cc92b0b5056f9981033766538 days 9 hrs ago0xc33bdb8051d6d2002c0d80a1dd23a1c9d9fc26e4 IN  0x366021610bf0d5ebfdc9041a7f8b152aa76e6d980 Ether0.000098936
0x9e8362ca8294b6c8179efcd3b2a981fc5db634935e9affed3c419c3bb38197901033765938 days 9 hrs ago0xc33bdb8051d6d2002c0d80a1dd23a1c9d9fc26e4 IN  0x366021610bf0d5ebfdc9041a7f8b152aa76e6d980 Ether0.00021255
0x1e8768b02b51176a03e3bbda2ef1d23fcaa3c68b7e7b576a7205d09963855fda1033765238 days 9 hrs ago0x0a2926f2e2c9d60aebf5cfe0911fbdefce47db5e IN  0x366021610bf0d5ebfdc9041a7f8b152aa76e6d980 Ether0.000589768
0xf268b9790df306772eb09410639392dc8871184527dfda01c90f1224fb1f9bbf1033763438 days 9 hrs ago0x0a2926f2e2c9d60aebf5cfe0911fbdefce47db5e IN  0x366021610bf0d5ebfdc9041a7f8b152aa76e6d980 Ether0.000676786
0x08814ce318e26b7a635364ab94e2867d93a4a501e06330f45958f753311f58931031669741 days 4 hrs ago0xea3f46c50ae211fe59107321a32af97f215df566 IN  0x366021610bf0d5ebfdc9041a7f8b152aa76e6d980 Ether0.000098936
0x47a90b2861bef5f3e4d1f74f119346647875c53687ffd0ad1bd68d9a5c39eda21031664241 days 5 hrs ago0xea3f46c50ae211fe59107321a32af97f215df566 IN  0x366021610bf0d5ebfdc9041a7f8b152aa76e6d980 Ether0.00009868
0x5e65223a90cc06941243272b99068399bc9e4df0f457a319eb68de7f0e2560d21029721743 days 7 hrs ago0xc33bdb8051d6d2002c0d80a1dd23a1c9d9fc26e4 IN  0x366021610bf0d5ebfdc9041a7f8b152aa76e6d980 Ether0.00004251
0x2c5109bba28882d2eaf6f400e8577b48a4756aece0bc83363e0a26f2cadfeffc1029721343 days 7 hrs ago0xc33bdb8051d6d2002c0d80a1dd23a1c9d9fc26e4 IN  0x366021610bf0d5ebfdc9041a7f8b152aa76e6d980 Ether0.00004251
0xb343fb24ee06bf45e3a5d90bf4fe8dc7beb8b60bb06babae50761a5e4b3882d51029707743 days 8 hrs ago0x5194b63f10691e46635b27925100cfc0a5ceca62 IN  0x366021610bf0d5ebfdc9041a7f8b152aa76e6d980 Ether0.000073657
0x35ff19d939c6935ec29f43b987353c066f935f90dfe0c5680ffacfac11fbccf71029706543 days 8 hrs ago0x5194b63f10691e46635b27925100cfc0a5ceca62 IN  0x366021610bf0d5ebfdc9041a7f8b152aa76e6d980 Ether0.000061526
0xc2cb42a75bcecf8df4cbd00ae2211ee7729ecf051bec676c32aa0e357603436d1029706143 days 8 hrs ago0x5194b63f10691e46635b27925100cfc0a5ceca62 IN  0x366021610bf0d5ebfdc9041a7f8b152aa76e6d980 Ether0.000058657
0x022b71d31293da00bf7a4c93bf260e8fa3aa2995758fcb21cfdea2993fc985b51029704943 days 8 hrs ago0xc33bdb8051d6d2002c0d80a1dd23a1c9d9fc26e4 IN  0x366021610bf0d5ebfdc9041a7f8b152aa76e6d980 Ether0.00004251
0x385a223f72f391e69a0ed5f2a71ba2bfc6446e0dd96db332a088e30dab5f9d0e1029640443 days 10 hrs ago0xea3f46c50ae211fe59107321a32af97f215df566 IN  0x366021610bf0d5ebfdc9041a7f8b152aa76e6d980 Ether0.000058657
0xc1092290d38699010184f9c70e49d279a2385e0ff474ce26e4b330a113dca7751029639643 days 10 hrs ago0xc33bdb8051d6d2002c0d80a1dd23a1c9d9fc26e4 IN  0x366021610bf0d5ebfdc9041a7f8b152aa76e6d980 Ether0.000042446
0x8b74cfd80f867c0e2bab8cca8654e2708beb7d2b20c3e46efec3389f5dcaf22a1029638443 days 10 hrs ago0x9677044a39550cebb01fa79bec04cf54e162d0c3 IN  0x366021610bf0d5ebfdc9041a7f8b152aa76e6d980 Ether0.000073657
0x195bf7b13759b7f3a5d44dba7d97679fad3c7f9fc5c9086d30aa43932364b02d1029191543 days 21 hrs ago0xc33bdb8051d6d2002c0d80a1dd23a1c9d9fc26e4 IN  0x366021610bf0d5ebfdc9041a7f8b152aa76e6d980 Ether0.000037221
[ Download CSV Export 

Internal Transactions as a result of Contract Execution

Parent TxHash Block Age From To Value
Warning: The compiled contract might be susceptible to ExpExponentCleanup (medium/high-severity), EventStructWrongData (very low-severity) Solidity Compiler Bugs.

Contract Source Code Verified (Similar Match)
Note: This contract matches the deployed ByteCode of the Verified Source Code for Contract 0x8d4b4481cD8A138D127c49a35E98cDae73D1cd90

Contract Name:
TokenContract

Compiler Version
v0.4.24+commit.e67f0147

Optimization Enabled:
Yes

Runs (Optimizer):
200

Contract Source Code

pragma solidity ^0.4.24;
// produced by the Solididy File Flattener (c) David Appleton 2018
// contact : [email protected]
// released under Apache 2.0 licence
library SafeMath {
  function mul(uint256 a, uint256 b) internal pure returns (uint256) {
    uint256 c = a * b;
    assert(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) {
    assert(b <= a);
    return a - b;
  }
  
  function add(uint256 a, uint256 b) internal pure returns (uint256) {
    uint256 c = a + b;
    assert(c >= a);
    return c;
  }
}

contract Ownable {
  address public owner;

  function Ownable() {
    owner = msg.sender;
  }

  modifier onlyOwner() {
    if (msg.sender == owner)
      _;
  }

  function transferOwnership(address newOwner) onlyOwner {
    if (newOwner != address(0)) owner = newOwner;
  }

}
library RLP {

 uint constant DATA_SHORT_START = 0x80;
 uint constant DATA_LONG_START = 0xB8;
 uint constant LIST_SHORT_START = 0xC0;
 uint constant LIST_LONG_START = 0xF8;

 uint constant DATA_LONG_OFFSET = 0xB7;
 uint constant LIST_LONG_OFFSET = 0xF7;


 struct RLPItem {
     uint _unsafe_memPtr;    // Pointer to the RLP-encoded bytes.
     uint _unsafe_length;    // Number of bytes. This is the full length of the string.
 }

 struct Iterator {
     RLPItem _unsafe_item;   // Item that's being iterated over.
     uint _unsafe_nextPtr;   // Position of the next item in the list.
 }

 /* Iterator */

 function next(Iterator memory self) internal constant returns (RLPItem memory subItem) {
     if(hasNext(self)) {
         var ptr = self._unsafe_nextPtr;
         var itemLength = _itemLength(ptr);
         subItem._unsafe_memPtr = ptr;
         subItem._unsafe_length = itemLength;
         self._unsafe_nextPtr = ptr + itemLength;
     }
     else
         revert();
 }

 function next(Iterator memory self, bool strict) internal constant returns (RLPItem memory subItem) {
     subItem = next(self);
     if(strict && !_validate(subItem))
         revert();
     return;
 }

 function hasNext(Iterator memory self) internal constant returns (bool) {
     var item = self._unsafe_item;
     return self._unsafe_nextPtr < item._unsafe_memPtr + item._unsafe_length;
 }

 /* RLPItem */

 /// @dev Creates an RLPItem from an array of RLP encoded bytes.
 /// @param self The RLP encoded bytes.
 /// @return An RLPItem
 function toRLPItem(bytes memory self) internal constant returns (RLPItem memory) {
     uint len = self.length;
     if (len == 0) {
         return RLPItem(0, 0);
     }
     uint memPtr;
     assembly {
         memPtr := add(self, 0x20)
     }
     return RLPItem(memPtr, len);
 }

 /// @dev Creates an RLPItem from an array of RLP encoded bytes.
 /// @param self The RLP encoded bytes.
 /// @param strict Will revert if the data is not RLP encoded.
 /// @return An RLPItem
 function toRLPItem(bytes memory self, bool strict) internal constant returns (RLPItem memory) {
     var item = toRLPItem(self);
     if(strict) {
         uint len = self.length;
         if(_payloadOffset(item) > len)
             revert();
         if(_itemLength(item._unsafe_memPtr) != len)
             revert();
         if(!_validate(item))
             revert();
     }
     return item;
 }

 /// @dev Check if the RLP item is null.
 /// @param self The RLP item.
 /// @return 'true' if the item is null.
 function isNull(RLPItem memory self) internal pure returns (bool ret) {
     return self._unsafe_length == 0;
 }

 /// @dev Check if the RLP item is a list.
 /// @param self The RLP item.
 /// @return 'true' if the item is a list.
 function isList(RLPItem memory self) internal pure returns (bool ret) {
     if (self._unsafe_length == 0)
         return false;
     uint memPtr = self._unsafe_memPtr;
     assembly {
         ret := iszero(lt(byte(0, mload(memPtr)), 0xC0))
     }
 }

 /// @dev Check if the RLP item is data.
 /// @param self The RLP item.
 /// @return 'true' if the item is data.
 function isData(RLPItem memory self) internal pure returns (bool ret) {
     if (self._unsafe_length == 0)
         return false;
     uint memPtr = self._unsafe_memPtr;
     assembly {
         ret := lt(byte(0, mload(memPtr)), 0xC0)
     }
 }

 /// @dev Check if the RLP item is empty (string or list).
 /// @param self The RLP item.
 /// @return 'true' if the item is null.
 function isEmpty(RLPItem memory self) internal pure returns (bool ret) {
     if (isNull(self)) {
         return false;
     }
     uint b0;
     uint memPtr = self._unsafe_memPtr;
     assembly {
         b0 := byte(0, mload(memPtr))
     }
     return (b0 == DATA_SHORT_START || b0 == LIST_SHORT_START);
 }

 /// @dev Get the number of items in an RLP encoded list.
 /// @param self The RLP item.
 /// @return The number of items.
 function items(RLPItem memory self) internal constant returns (uint) {
     if (!isList(self))
         return 0;
     uint b0;
     uint memPtr = self._unsafe_memPtr;
     assembly {
         b0 := byte(0, mload(memPtr))
     }
     uint pos = memPtr + _payloadOffset(self);
     uint last = memPtr + self._unsafe_length - 1;
     uint itms;
     while (pos <= last) {
         pos += _itemLength(pos);
         itms++;
     }
     return itms;
 }

 /// @dev Create an iterator.
 /// @param self The RLP item.
 /// @return An 'Iterator' over the item.
 function iterator(RLPItem memory self) internal constant returns (Iterator memory it) {
     if (!isList(self))
         revert();
     uint ptr = self._unsafe_memPtr + _payloadOffset(self);
     it._unsafe_item = self;
     it._unsafe_nextPtr = ptr;
 }

 /// @dev Return the RLP encoded bytes.
 /// @param self The RLPItem.
 /// @return The bytes.
 function toBytes(RLPItem memory self) internal constant returns (bytes memory bts) {
     var len = self._unsafe_length;
     if (len == 0)
         return;
     bts = new bytes(len);
     _copyToBytes(self._unsafe_memPtr, bts, len);
 }

 /// @dev Decode an RLPItem into bytes. This will not work if the
 /// RLPItem is a list.
 /// @param self The RLPItem.
 /// @return The decoded string.
 function toData(RLPItem memory self) internal constant returns (bytes memory bts) {
     if(!isData(self))
         revert();
     var (rStartPos, len) = _decode(self);
     bts = new bytes(len);
     _copyToBytes(rStartPos, bts, len);
 }

 /// @dev Get the list of sub-items from an RLP encoded list.
 /// Warning: This is inefficient, as it requires that the list is read twice.
 /// @param self The RLP item.
 /// @return Array of RLPItems.
 function toList(RLPItem memory self) internal constant returns (RLPItem[] memory list) {
     if(!isList(self))
         revert();
     var numItems = items(self);
     list = new RLPItem[](numItems);
     var it = iterator(self);
     uint idx;
     while(hasNext(it)) {
         list[idx] = next(it);
         idx++;
     }
 }

 /// @dev Decode an RLPItem into an ascii string. This will not work if the
 /// RLPItem is a list.
 /// @param self The RLPItem.
 /// @return The decoded string.
 function toAscii(RLPItem memory self) internal constant returns (string memory str) {
     if(!isData(self))
         revert();
     var (rStartPos, len) = _decode(self);
     bytes memory bts = new bytes(len);
     _copyToBytes(rStartPos, bts, len);
     str = string(bts);
 }

 /// @dev Decode an RLPItem into a uint. This will not work if the
 /// RLPItem is a list.
 /// @param self The RLPItem.
 /// @return The decoded string.
 function toUint(RLPItem memory self) internal constant returns (uint data) {
     if(!isData(self))
         revert();
     var (rStartPos, len) = _decode(self);
     if (len > 32 || len == 0)
         revert();
     assembly {
         data := div(mload(rStartPos), exp(256, sub(32, len)))
     }
 }

 /// @dev Decode an RLPItem into a boolean. This will not work if the
 /// RLPItem is a list.
 /// @param self The RLPItem.
 /// @return The decoded string.
 function toBool(RLPItem memory self) internal constant returns (bool data) {
     if(!isData(self))
         revert();
     var (rStartPos, len) = _decode(self);
     if (len != 1)
         revert();
     uint temp;
     assembly {
         temp := byte(0, mload(rStartPos))
     }
     if (temp > 1)
         revert();
     return temp == 1 ? true : false;
 }

 /// @dev Decode an RLPItem into a byte. This will not work if the
 /// RLPItem is a list.
 /// @param self The RLPItem.
 /// @return The decoded string.
 function toByte(RLPItem memory self) internal constant returns (byte data) {
     if(!isData(self))
         revert();
     var (rStartPos, len) = _decode(self);
     if (len != 1)
         revert();
     uint temp;
     assembly {
         temp := byte(0, mload(rStartPos))
     }
     return byte(temp);
 }

 /// @dev Decode an RLPItem into an int. This will not work if the
 /// RLPItem is a list.
 /// @param self The RLPItem.
 /// @return The decoded string.
 function toInt(RLPItem memory self) internal constant returns (int data) {
     return int(toUint(self));
 }

 /// @dev Decode an RLPItem into a bytes32. This will not work if the
 /// RLPItem is a list.
 /// @param self The RLPItem.
 /// @return The decoded string.
 function toBytes32(RLPItem memory self) internal constant returns (bytes32 data) {
     return bytes32(toUint(self));
 }

 /// @dev Decode an RLPItem into an address. This will not work if the
 /// RLPItem is a list.
 /// @param self The RLPItem.
 /// @return The decoded string.
 function toAddress(RLPItem memory self) internal constant returns (address data) {
     if(!isData(self))
         revert();
     var (rStartPos, len) = _decode(self);
     if (len != 20)
         revert();
     assembly {
         data := div(mload(rStartPos), exp(256, 12))
     }
 }

 // Get the payload offset.
 function _payloadOffset(RLPItem memory self) private constant returns (uint) {
     if(self._unsafe_length == 0)
         return 0;
     uint b0;
     uint memPtr = self._unsafe_memPtr;
     assembly {
         b0 := byte(0, mload(memPtr))
     }
     if(b0 < DATA_SHORT_START)
         return 0;
     if(b0 < DATA_LONG_START || (b0 >= LIST_SHORT_START && b0 < LIST_LONG_START))
         return 1;
     if(b0 < LIST_SHORT_START)
         return b0 - DATA_LONG_OFFSET + 1;
     return b0 - LIST_LONG_OFFSET + 1;
 }

 // Get the full length of an RLP item.
 function _itemLength(uint memPtr) private constant returns (uint len) {
     uint b0;
     assembly {
         b0 := byte(0, mload(memPtr))
     }
     if (b0 < DATA_SHORT_START)
         len = 1;
     else if (b0 < DATA_LONG_START)
         len = b0 - DATA_SHORT_START + 1;
     else if (b0 < LIST_SHORT_START) {
         assembly {
             let bLen := sub(b0, 0xB7) // bytes length (DATA_LONG_OFFSET)
             let dLen := div(mload(add(memPtr, 1)), exp(256, sub(32, bLen))) // data length
             len := add(1, add(bLen, dLen)) // total length
         }
     }
     else if (b0 < LIST_LONG_START)
         len = b0 - LIST_SHORT_START + 1;
     else {
         assembly {
             let bLen := sub(b0, 0xF7) // bytes length (LIST_LONG_OFFSET)
             let dLen := div(mload(add(memPtr, 1)), exp(256, sub(32, bLen))) // data length
             len := add(1, add(bLen, dLen)) // total length
         }
     }
 }

 // Get start position and length of the data.
 function _decode(RLPItem memory self) private constant returns (uint memPtr, uint len) {
     if(!isData(self))
         revert();
     uint b0;
     uint start = self._unsafe_memPtr;
     assembly {
         b0 := byte(0, mload(start))
     }
     if (b0 < DATA_SHORT_START) {
         memPtr = start;
         len = 1;
         return;
     }
     if (b0 < DATA_LONG_START) {
         len = self._unsafe_length - 1;
         memPtr = start + 1;
     } else {
         uint bLen;
         assembly {
             bLen := sub(b0, 0xB7) // DATA_LONG_OFFSET
         }
         len = self._unsafe_length - 1 - bLen;
         memPtr = start + bLen + 1;
     }
     return;
 }

 // Assumes that enough memory has been allocated to store in target.
 function _copyToBytes(uint btsPtr, bytes memory tgt, uint btsLen) private constant {
     // Exploiting the fact that 'tgt' was the last thing to be allocated,
     // we can write entire words, and just overwrite any excess.
     assembly {
         {
                 let i := 0 // Start at arr + 0x20
                 let words := div(add(btsLen, 31), 32)
                 let rOffset := btsPtr
                 let wOffset := add(tgt, 0x20)
             tag_loop:
                 jumpi(end, eq(i, words))
                 {
                     let offset := mul(i, 0x20)
                     mstore(add(wOffset, offset), mload(add(rOffset, offset)))
                     i := add(i, 1)
                 }
                 jump(tag_loop)
             end:
                 mstore(add(tgt, add(0x20, mload(tgt))), 0)
         }
     }
 }

     // Check that an RLP item is valid.
     function _validate(RLPItem memory self) private constant returns (bool ret) {
         // Check that RLP is well-formed.
         uint b0;
         uint b1;
         uint memPtr = self._unsafe_memPtr;
         assembly {
             b0 := byte(0, mload(memPtr))
             b1 := byte(1, mload(memPtr))
         }
         if(b0 == DATA_SHORT_START + 1 && b1 < DATA_SHORT_START)
             return false;
         return true;
     }
}

library BytesLib {
    function concat(bytes memory _preBytes, bytes memory _postBytes) internal pure returns (bytes) {
        bytes memory tempBytes;

        assembly {
            // Get a location of some free memory and store it in tempBytes as
            // Solidity does for memory variables.
            tempBytes := mload(0x40)

            // Store the length of the first bytes array at the beginning of
            // the memory for tempBytes.
            let length := mload(_preBytes)
            mstore(tempBytes, length)

            // Maintain a memory counter for the current write location in the
            // temp bytes array by adding the 32 bytes for the array length to
            // the starting location.
            let mc := add(tempBytes, 0x20)
            // Stop copying when the memory counter reaches the length of the
            // first bytes array.
            let end := add(mc, length)

            for {
                // Initialize a copy counter to the start of the _preBytes data,
                // 32 bytes into its memory.
                let cc := add(_preBytes, 0x20)
            } lt(mc, end) {
                // Increase both counters by 32 bytes each iteration.
                mc := add(mc, 0x20)
                cc := add(cc, 0x20)
            } {
                // Write the _preBytes data into the tempBytes memory 32 bytes
                // at a time.
                mstore(mc, mload(cc))
            }

            // Add the length of _postBytes to the current length of tempBytes
            // and store it as the new length in the first 32 bytes of the
            // tempBytes memory.
            length := mload(_postBytes)
            mstore(tempBytes, add(length, mload(tempBytes)))

            // Move the memory counter back from a multiple of 0x20 to the
            // actual end of the _preBytes data.
            mc := end
            // Stop copying when the memory counter reaches the new combined
            // length of the arrays.
            end := add(mc, length)

            for {
                let cc := add(_postBytes, 0x20)
            } lt(mc, end) {
                mc := add(mc, 0x20)
                cc := add(cc, 0x20)
            } {
                mstore(mc, mload(cc))
            }

            // Update the free-memory pointer by padding our last write location
            // to 32 bytes: add 31 bytes to the end of tempBytes to move to the
            // next 32 byte block, then round down to the nearest multiple of
            // 32. If the sum of the length of the two arrays is zero then add 
            // one before rounding down to leave a blank 32 bytes (the length block with 0).
            mstore(0x40, and(
              add(add(end, iszero(add(length, mload(_preBytes)))), 31),
              not(31) // Round down to the nearest 32 bytes.
            ))
        }

        return tempBytes;
    }

    function concatStorage(bytes storage _preBytes, bytes memory _postBytes) internal {
        assembly {
            // Read the first 32 bytes of _preBytes storage, which is the length
            // of the array. (We don't need to use the offset into the slot
            // because arrays use the entire slot.)
            let fslot := sload(_preBytes_slot)
            // Arrays of 31 bytes or less have an even value in their slot,
            // while longer arrays have an odd value. The actual length is
            // the slot divided by two for odd values, and the lowest order
            // byte divided by two for even values.
            // If the slot is even, bitwise and the slot with 255 and divide by
            // two to get the length. If the slot is odd, bitwise and the slot
            // with -1 and divide by two.
            let slength := div(and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)), 2)
            let mlength := mload(_postBytes)
            let newlength := add(slength, mlength)
            // slength can contain both the length and contents of the array
            // if length < 32 bytes so let's prepare for that
            // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage
            switch add(lt(slength, 32), lt(newlength, 32))
            case 2 {
                // Since the new array still fits in the slot, we just need to
                // update the contents of the slot.
                // uint256(bytes_storage) = uint256(bytes_storage) + uint256(bytes_memory) + new_length
                sstore(
                    _preBytes_slot,
                    // all the modifications to the slot are inside this
                    // next block
                    add(
                        // we can just add to the slot contents because the
                        // bytes we want to change are the LSBs
                        fslot,
                        add(
                            mul(
                                div(
                                    // load the bytes from memory
                                    mload(add(_postBytes, 0x20)),
                                    // zero all bytes to the right
                                    exp(0x100, sub(32, mlength))
                                ),
                                // and now shift left the number of bytes to
                                // leave space for the length in the slot
                                exp(0x100, sub(32, newlength))
                            ),
                            // increase length by the double of the memory
                            // bytes length
                            mul(mlength, 2)
                        )
                    )
                )
            }
            case 1 {
                // The stored value fits in the slot, but the combined value
                // will exceed it.
                // get the keccak hash to get the contents of the array
                mstore(0x0, _preBytes_slot)
                let sc := add(keccak256(0x0, 0x20), div(slength, 32))

                // save new length
                sstore(_preBytes_slot, add(mul(newlength, 2), 1))

                // The contents of the _postBytes array start 32 bytes into
                // the structure. Our first read should obtain the `submod`
                // bytes that can fit into the unused space in the last word
                // of the stored array. To get this, we read 32 bytes starting
                // from `submod`, so the data we read overlaps with the array
                // contents by `submod` bytes. Masking the lowest-order
                // `submod` bytes allows us to add that value directly to the
                // stored value.

                let submod := sub(32, slength)
                let mc := add(_postBytes, submod)
                let end := add(_postBytes, mlength)
                let mask := sub(exp(0x100, submod), 1)

                sstore(
                    sc,
                    add(
                        and(
                            fslot,
                            0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00
                        ),
                        and(mload(mc), mask)
                    )
                )

                for {
                    mc := add(mc, 0x20)
                    sc := add(sc, 1)
                } lt(mc, end) {
                    sc := add(sc, 1)
                    mc := add(mc, 0x20)
                } {
                    sstore(sc, mload(mc))
                }

                mask := exp(0x100, sub(mc, end))

                sstore(sc, mul(div(mload(mc), mask), mask))
            }
            default {
                // get the keccak hash to get the contents of the array
                mstore(0x0, _preBytes_slot)
                // Start copying to the last used word of the stored array.
                let sc := add(keccak256(0x0, 0x20), div(slength, 32))

                // save new length
                sstore(_preBytes_slot, add(mul(newlength, 2), 1))

                // Copy over the first `submod` bytes of the new data as in
                // case 1 above.
                let slengthmod := mod(slength, 32)
                let mlengthmod := mod(mlength, 32)
                let submod := sub(32, slengthmod)
                let mc := add(_postBytes, submod)
                let end := add(_postBytes, mlength)
                let mask := sub(exp(0x100, submod), 1)

                sstore(sc, add(sload(sc), and(mload(mc), mask)))
                
                for { 
                    sc := add(sc, 1)
                    mc := add(mc, 0x20)
                } lt(mc, end) {
                    sc := add(sc, 1)
                    mc := add(mc, 0x20)
                } {
                    sstore(sc, mload(mc))
                }

                mask := exp(0x100, sub(mc, end))

                sstore(sc, mul(div(mload(mc), mask), mask))
            }
        }
    }

    function slice(bytes _bytes, uint _start, uint _length) internal  pure returns (bytes) {
        require(_bytes.length >= (_start + _length));

        bytes memory tempBytes;

        assembly {
            switch iszero(_length)
            case 0 {
                // Get a location of some free memory and store it in tempBytes as
                // Solidity does for memory variables.
                tempBytes := mload(0x40)

                // The first word of the slice result is potentially a partial
                // word read from the original array. To read it, we calculate
                // the length of that partial word and start copying that many
                // bytes into the array. The first word we copy will start with
                // data we don't care about, but the last `lengthmod` bytes will
                // land at the beginning of the contents of the new array. When
                // we're done copying, we overwrite the full first word with
                // the actual length of the slice.
                let lengthmod := and(_length, 31)

                // The multiplication in the next line is necessary
                // because when slicing multiples of 32 bytes (lengthmod == 0)
                // the following copy loop was copying the origin's length
                // and then ending prematurely not copying everything it should.
                let mc := add(add(tempBytes, lengthmod), mul(0x20, iszero(lengthmod)))
                let end := add(mc, _length)

                for {
                    // The multiplication in the next line has the same exact purpose
                    // as the one above.
                    let cc := add(add(add(_bytes, lengthmod), mul(0x20, iszero(lengthmod))), _start)
                } lt(mc, end) {
                    mc := add(mc, 0x20)
                    cc := add(cc, 0x20)
                } {
                    mstore(mc, mload(cc))
                }

                mstore(tempBytes, _length)

                //update free-memory pointer
                //allocating the array padded to 32 bytes like the compiler does now
                mstore(0x40, and(add(mc, 31), not(31)))
            }
            //if we want a zero-length slice let's just return a zero-length array
            default {
                tempBytes := mload(0x40)

                mstore(0x40, add(tempBytes, 0x20))
            }
        }

        return tempBytes;
    }

    function toAddress(bytes _bytes, uint _start) internal  pure returns (address) {
        require(_bytes.length >= (_start + 20));
        address tempAddress;

        assembly {
            tempAddress := div(mload(add(add(_bytes, 0x20), _start)), 0x1000000000000000000000000)
        }

        return tempAddress;
    }

    function toUint(bytes _bytes, uint _start) internal  pure returns (uint256) {
        require(_bytes.length >= (_start + 32));
        uint256 tempUint;

        assembly {
            tempUint := mload(add(add(_bytes, 0x20), _start))
        }

        return tempUint;
    }

    function equal(bytes memory _preBytes, bytes memory _postBytes) internal pure returns (bool) {
        bool success = true;

        assembly {
            let length := mload(_preBytes)

            // if lengths don't match the arrays are not equal
            switch eq(length, mload(_postBytes))
            case 1 {
                // cb is a circuit breaker in the for loop since there's
                //  no said feature for inline assembly loops
                // cb = 1 - don't breaker
                // cb = 0 - break
                let cb := 1

                let mc := add(_preBytes, 0x20)
                let end := add(mc, length)

                for {
                    let cc := add(_postBytes, 0x20)
                // the next line is the loop condition:
                // while(uint(mc < end) + cb == 2)
                } eq(add(lt(mc, end), cb), 2) {
                    mc := add(mc, 0x20)
                    cc := add(cc, 0x20)
                } {
                    // if any of these checks fails then arrays are not equal
                    if iszero(eq(mload(mc), mload(cc))) {
                        // unsuccess:
                        success := 0
                        cb := 0
                    }
                }
            }
            default {
                // unsuccess:
                success := 0
            }
        }

        return success;
    }

    function equalStorage(bytes storage _preBytes, bytes memory _postBytes) internal view returns (bool) {
        bool success = true;

        assembly {
            // we know _preBytes_offset is 0
            let fslot := sload(_preBytes_slot)
            // Decode the length of the stored array like in concatStorage().
            let slength := div(and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)), 2)
            let mlength := mload(_postBytes)

            // if lengths don't match the arrays are not equal
            switch eq(slength, mlength)
            case 1 {
                // slength can contain both the length and contents of the array
                // if length < 32 bytes so let's prepare for that
                // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage
                if iszero(iszero(slength)) {
                    switch lt(slength, 32)
                    case 1 {
                        // blank the last byte which is the length
                        fslot := mul(div(fslot, 0x100), 0x100)

                        if iszero(eq(fslot, mload(add(_postBytes, 0x20)))) {
                            // unsuccess:
                            success := 0
                        }
                    }
                    default {
                        // cb is a circuit breaker in the for loop since there's
                        //  no said feature for inline assembly loops
                        // cb = 1 - don't breaker
                        // cb = 0 - break
                        let cb := 1

                        // get the keccak hash to get the contents of the array
                        mstore(0x0, _preBytes_slot)
                        let sc := keccak256(0x0, 0x20)

                        let mc := add(_postBytes, 0x20)
                        let end := add(mc, mlength)

                        // the next line is the loop condition:
                        // while(uint(mc < end) + cb == 2)
                        for {} eq(add(lt(mc, end), cb), 2) {
                            sc := add(sc, 1)
                            mc := add(mc, 0x20)
                        } {
                            if iszero(eq(sload(sc), mload(mc))) {
                                // unsuccess:
                                success := 0
                                cb := 0
                            }
                        }
                    }
                }
            }
            default {
                // unsuccess:
                success := 0
            }
        }

        return success;
    }
}
contract ERC721Basic {


  event Transfer(
    address indexed _from,
    address indexed _to,
    uint256 indexed _tokenId
  );
  event Approval(
    address indexed _owner,
    address indexed _approved,
    uint256 indexed _tokenId
  );
  event ApprovalForAll(
    address indexed _owner,
    address indexed _operator,
    bool _approved
  );

  function balanceOf(address _owner) public view returns (uint256 _balance);
  function ownerOf(uint256 _tokenId) public view returns (address _owner);
  function exists(uint256 _tokenId) public view returns (bool _exists);

  function approve(address _to, uint256 _tokenId) public;
  function getApproved(uint256 _tokenId)
    public view returns (address _operator);

  function setApprovalForAll(address _operator, bool _approved) public;
  function isApprovedForAll(address _owner, address _operator)
    public view returns (bool);

  function transferFrom(address _from, address _to, uint256 _tokenId, uint256 _declaredNonce) public;
}
library AddressUtils {

  /**
   * Returns whether the target address is a contract
   * @dev This function will return false if invoked during the constructor of a contract,
   * as the code is not actually created until after the constructor finishes.
   * @param _addr address to check
   * @return whether the target address is a contract
   */
  function isContract(address _addr) internal view returns (bool) {
    uint256 size;
    // XXX Currently there is no better way to check if there is a contract in an address
    // than to check the size of the code at that address.
    // See https://ethereum.stackexchange.com/a/14016/36603
    // for more details about how this works.
    // TODO Check this again before the Serenity release, because all addresses will be
    // contracts then.
    // solium-disable-next-line security/no-inline-assembly
    assembly { size := extcodesize(_addr) }
    return size > 0;
  }

}
contract ERC721BasicToken is ERC721Basic {

  using SafeMath for uint256;
  using AddressUtils for address;

  // Mapping from token ID to owner
  mapping (uint256 => address) internal tokenOwner;

  // Mapping from token ID to approved address
  mapping (uint256 => address) internal tokenApprovals;

  // Mapping from owner to number of owned token
  mapping (address => uint256) internal ownedTokensCount;

  // Mapping from owner to operator approvals
  mapping (address => mapping (address => bool)) internal operatorApprovals;

  constructor()
    public
  {

  }

  /**
   * @dev Gets the balance of the specified address
   * @param _owner address to query the balance of
   * @return uint256 representing the amount owned by the passed address
   */
  function balanceOf(address _owner) public view returns (uint256) {
    require(_owner != address(0));
    return ownedTokensCount[_owner];
  }

  /**
   * @dev Gets the owner of the specified token ID
   * @param _tokenId uint256 ID of the token to query the owner of
   * @return owner address currently marked as the owner of the given token ID
   */
  function ownerOf(uint256 _tokenId) public view returns (address) {
    address owner = tokenOwner[_tokenId];
    require(owner != address(0));
    return owner;
  }

  /**
   * @dev Returns whether the specified token exists
   * @param _tokenId uint256 ID of the token to query the existence of
   * @return whether the token exists
   */
  function exists(uint256 _tokenId) public view returns (bool) {
    address owner = tokenOwner[_tokenId];
    return owner != address(0);
  }

  /**
   * @dev Approves another address to transfer the given token ID
   * The zero address indicates there is no approved address.
   * There can only be one approved address per token at a given time.
   * Can only be called by the token owner or an approved operator.
   * @param _to address to be approved for the given token ID
   * @param _tokenId uint256 ID of the token to be approved
   */
  function approve(address _to, uint256 _tokenId) public {
    address owner = ownerOf(_tokenId);
    require(_to != owner);
    require(msg.sender == owner || isApprovedForAll(owner, msg.sender));

    tokenApprovals[_tokenId] = _to;
    emit Approval(owner, _to, _tokenId);
  }

  /**
   * @dev Gets the approved address for a token ID, or zero if no address set
   * @param _tokenId uint256 ID of the token to query the approval of
   * @return address currently approved for the given token ID
   */
  function getApproved(uint256 _tokenId) public view returns (address) {
    return tokenApprovals[_tokenId];
  }

  /**
   * @dev Sets or unsets the approval of a given operator
   * An operator is allowed to transfer all tokens of the sender on their behalf
   * @param _to operator address to set the approval
   * @param _approved representing the status of the approval to be set
   */
  function setApprovalForAll(address _to, bool _approved) public {
    require(_to != msg.sender);
    operatorApprovals[msg.sender][_to] = _approved;
    emit ApprovalForAll(msg.sender, _to, _approved);
  }

  /**
   * @dev Tells whether an operator is approved by a given owner
   * @param _owner owner address which you want to query the approval of
   * @param _operator operator address which you want to query the approval of
   * @return bool whether the given operator is approved by the given owner
   */
  function isApprovedForAll(
    address _owner,
    address _operator
  )
    public
    view
    returns (bool)
  {
    return operatorApprovals[_owner][_operator];
  }

  /**
   * @dev Returns whether the given spender can transfer a given token ID
   * @param _spender address of the spender to query
   * @param _tokenId uint256 ID of the token to be transferred
   * @return bool whether the msg.sender is approved for the given token ID,
   *  is an operator of the owner, or is the owner of the token
   */
  function isApprovedOrOwner(
    address _spender,
    uint256 _tokenId
  )
    internal
    view
    returns (bool)
  {
    address owner = ownerOf(_tokenId);
    // Disable solium check because of
    // https://github.com/duaraghav8/Solium/issues/175
    // solium-disable-next-line operator-whitespace
    return (
      _spender == owner ||
      getApproved(_tokenId) == _spender ||
      isApprovedForAll(owner, _spender)
    );
  }

  /**
   * @dev Internal function to mint a new token
   * Reverts if the given token ID already exists
   * @param _to The address that will own the minted token
   * @param _tokenId uint256 ID of the token to be minted by the msg.sender
   */
  function _mint(address _to, uint256 _tokenId) internal {
    require(_to != address(0));
    addTokenTo(_to, _tokenId);
    emit Transfer(address(0), _to, _tokenId);
  }

  /**
   * @dev Internal function to burn a specific token
   * Reverts if the token does not exist
   * @param _tokenId uint256 ID of the token being burned by the msg.sender
   */
  function _burn(address _owner, uint256 _tokenId) internal {
    clearApproval(_owner, _tokenId);
    removeTokenFrom(_owner, _tokenId);
    emit Transfer(_owner, address(0), _tokenId);
  }

  /**
   * @dev Internal function to clear current approval of a given token ID
   * Reverts if the given address is not indeed the owner of the token
   * @param _owner owner of the token
   * @param _tokenId uint256 ID of the token to be transferred
   */
  function clearApproval(address _owner, uint256 _tokenId) internal {
    require(ownerOf(_tokenId) == _owner);
    if (tokenApprovals[_tokenId] != address(0)) {
      tokenApprovals[_tokenId] = address(0);
    }
  }

  /**
   * @dev Internal function to add a token ID to the list of a given address
   * @param _to address representing the new owner of the given token ID
   * @param _tokenId uint256 ID of the token to be added to the tokens list of the given address
   */
  function addTokenTo(address _to, uint256 _tokenId) internal {
    require(tokenOwner[_tokenId] == address(0));
    tokenOwner[_tokenId] = _to;
    ownedTokensCount[_to] = ownedTokensCount[_to].add(1);
  }

  /**
   * @dev Internal function to remove a token ID from the list of a given address
   * @param _from address representing the previous owner of the given token ID
   * @param _tokenId uint256 ID of the token to be removed from the tokens list of the given address
   */
  function removeTokenFrom(address _from, uint256 _tokenId) internal {
    require(ownerOf(_tokenId) == _from);
    ownedTokensCount[_from] = ownedTokensCount[_from].sub(1);
    tokenOwner[_tokenId] = address(0);
  }

  /**
   * @dev Internal function to invoke `onERC721Received` on a target address
   * The call is not executed if the target address is not a contract
   * @param _from address representing the previous owner of the given token ID
   * @param _to target address that will receive the tokens
   * @param _tokenId uint256 ID of the token to be transferred
   * @param _data bytes optional data to send along with the call
   * @return whether the call correctly returned the expected magic value
   */
  function checkAndCallSafeTransfer(
    address _from,
    address _to,
    uint256 _tokenId,
    bytes _data
  )
    internal
    returns (bool)
  {
    if (!_to.isContract()) {
      return true;
    }

  }
}
contract TokenContract is ERC721BasicToken {
  using SafeMath for uint256;
  using RLP for RLP.RLPItem;
  using RLP for RLP.Iterator;
  using RLP for bytes;
  using BytesLib for bytes;

  address depositContract;
  address custodian;
  address custodianHome;
  uint256 mintedAmount;
  uint256 public mintNonce = 0;
  mapping (uint256 => uint256) public transferNonce;
  mapping (bytes32 => address) public custodianApproval;

  constructor (address _custodian) {
    custodian = _custodian;
  }

  modifier onlyCustodian() {
    require(custodian == msg.sender);
    _;
  }

  event Mint(uint256 amount,
             address indexed depositedTo,
             uint256 mintNonce,
             uint256 tokenId);
  event Withdraw(uint256 tokenId);
  event TransferRequest(address indexed from,
                        address indexed to,
                        uint256 indexed tokenId,
                        uint256 declaredNonce,
                        bytes32 approvalHash);

  function setDepositContract(address _depositContract) onlyCustodian public {
    depositContract = _depositContract;
  }

  function mint(uint256 _value, address _to) public {
    //might have to log the value, to, Z details
    bytes memory value = uint256ToBytes(_value);
    bytes memory to = addressToBytes(_to);
    bytes memory Z = uint256ToBytes(mintNonce);
    uint256 tokenId = bytes32ToUint256(keccak256(value.concat(to).concat(Z)));
    _mint(_to, tokenId);
    emit Mint(_value, _to, mintNonce, tokenId);
    mintNonce += 1;
  }

  function withdraw(uint256 _tokenId) public {
    emit Withdraw(_tokenId);
    //USED TO ANNOUNCE A WITHDRAWL (DOESNT NECESSISTATE SUBMISSION)
  }

  /* ERC721 Related Functions --------------------------------------------------*/
  // Mapping from token ID to approved address

  /**
   * @dev Requests transfer of ownership of a given token ID to another address
   * Usage of this method is discouraged, use `safeTransferFrom` whenever possible
   * Requires the msg sender to be the owner, approved, or operator
   * @param _from current owner of the token
   * @param _to address to receive the ownership of the given token ID
   * @param _tokenId uint256 ID of the token to be transferred
   * @param _declaredNonce uint256 nonce, depth of transaction
  */

  function transferFrom(
    address _from,
    address _to,
    uint256 _tokenId,
    uint256 _declaredNonce
  )
    public
  {
    require(isApprovedOrOwner(msg.sender, _tokenId));
    require(_from != address(0));
    require(_to != address(0));
    require(_declaredNonce == transferNonce[_tokenId]);

    clearApproval(_from, _tokenId);
    //TODO: Double check if hash is secure, no chance of collision
    bytes32 approvalHash = keccak256(uint256ToBytes(_tokenId)
                           .concat(uint256ToBytes(_declaredNonce)));
    custodianApproval[approvalHash] = _to;
    transferNonce[_tokenId] += 1;
    emit TransferRequest(_from, _to, _tokenId, _declaredNonce, approvalHash);
  }

  function custodianApprove(uint256 _tokenId, uint256 _declaredNonce)
  onlyCustodian public {
    require(exists(_tokenId));
    bytes32 approvalHash = keccak256(uint256ToBytes(_tokenId)
                           .concat(uint256ToBytes(_declaredNonce)));
    address _to = custodianApproval[approvalHash];
    address _from = ownerOf(_tokenId);
    removeTokenFrom(_from, _tokenId);
    addTokenTo(_to, _tokenId);
    emit Transfer(_from, _to, _tokenId);
    clearCustodianApproval(approvalHash);
  }

  function revertTransfer(uint256 _tokenId, uint256 _declaredNonce) public {
    require(isApprovedOrOwner(msg.sender, _tokenId), "no approval/ not owner");
    clearCustodianApproval(keccak256(uint256ToBytes(_tokenId)
                          .concat(uint256ToBytes(_declaredNonce))));
  }


  /* View functions --------------------------------------------------*/
  function viewTransferRequest(bytes32 _approvalHash) public view
  returns(address) {
    return custodianApproval[_approvalHash];
  }

  /* Util functions --------------------------------------------------*/
  /**
   * @dev Internal function to clear current custodian approval of a given token ID
   * @param _approvalHash bytes32 ID of the token to be transferred
   */
  function clearCustodianApproval(bytes32 _approvalHash) internal {
    if (custodianApproval[_approvalHash] != address(0)) {
      custodianApproval[_approvalHash] = address(0);
    }
  }

  function bytesToBytes32(bytes b, uint offset) private pure returns (bytes32) {
    bytes32 out;
    for (uint i = 0; i < 32; i++) {
      out |= bytes32(b[offset + i] & 0xFF) >> (i * 8);
    }
    return out;
  }

  function stringToBytes( string s) internal returns (bytes memory b3){
    b3 = bytes(s);
    return b3;
  }

  // Nick Johnson https://ethereum.stackexchange.com/questions/4170/how-to-convert-a-uint-to-bytes-in-solidity
  function uint256ToBytes(uint256 x) internal returns (bytes b) {
    b = new bytes(32);
    assembly { mstore(add(b, 32), x) }
  }

  // Tjaden Hess https://ethereum.stackexchange.com/questions/884/how-to-convert-an-address-to-bytes-in-solidity
  function addressToBytes(address a) internal returns (bytes b) {
    assembly {
        let m := mload(0x40)
        mstore(add(m, 20), xor(0x140000000000000000000000000000000000000000, a))
        mstore(0x40, add(m, 52))
        b := m
    }
  }

  // https://ethereum.stackexchange.com/questions/6498/how-to-convert-a-uint256-type-integer-into-a-bytes32
  function bytes32ToUint256(bytes32 n) internal returns (uint256) {
    return uint256(n);
  }

}

Contract ABI

[{"constant":true,"inputs":[{"name":"_tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_tokenId","type":"uint256"}],"name":"approve","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_depositContract","type":"address"}],"name":"setDepositContract","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"custodianApproval","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_tokenId","type":"uint256"}],"name":"withdraw","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_tokenId","type":"uint256"},{"name":"_declaredNonce","type":"uint256"}],"name":"revertTransfer","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_tokenId","type":"uint256"}],"name":"exists","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"transferNonce","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_tokenId","type":"uint256"},{"name":"_declaredNonce","type":"uint256"}],"name":"custodianApprove","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"mintNonce","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_value","type":"uint256"},{"name":"_to","type":"address"}],"name":"mint","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_approvalHash","type":"bytes32"}],"name":"viewTransferRequest","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"},{"name":"_operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_tokenId","type":"uint256"},{"name":"_declaredNonce","type":"uint256"}],"name":"transferFrom","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"_custodian","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"amount","type":"uint256"},{"indexed":true,"name":"depositedTo","type":"address"},{"indexed":false,"name":"mintNonce","type":"uint256"},{"indexed":false,"name":"tokenId","type":"uint256"}],"name":"Mint","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"tokenId","type":"uint256"}],"name":"Withdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"address"},{"indexed":true,"name":"to","type":"address"},{"indexed":true,"name":"tokenId","type":"uint256"},{"indexed":false,"name":"declaredNonce","type":"uint256"},{"indexed":false,"name":"approvalHash","type":"bytes32"}],"name":"TransferRequest","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_from","type":"address"},{"indexed":true,"name":"_to","type":"address"},{"indexed":true,"name":"_tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_owner","type":"address"},{"indexed":true,"name":"_approved","type":"address"},{"indexed":true,"name":"_tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_owner","type":"address"},{"indexed":true,"name":"_operator","type":"address"},{"indexed":false,"name":"_approved","type":"bool"}],"name":"ApprovalForAll","type":"event"}]

Contract Creation Code

6080604052600060085534801561001557600080fd5b50604051602080610e46833981016040525160058054600160a060020a031916600160a060020a03909216919091179055610df1806100556000396000f3006080604052600436106100f05763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663081812fc81146100f5578063095ea7b3146101295780630ec2e8211461014f5780630f32037f146101705780632e1a7d4d146101885780634174dd39146101a05780634f558e79146101bb5780636352211e146101e75780636e303cad146101ff5780636e3c045e1461022957806370a0823114610244578063931679a21461026557806394bf804d1461027a578063a07727571461029e578063a22cb465146102b6578063e985e9c5146102dc578063fe99049a14610303575b600080fd5b34801561010157600080fd5b5061010d600435610330565b60408051600160a060020a039092168252519081900360200190f35b34801561013557600080fd5b5061014d600160a060020a036004351660243561034b565b005b34801561015b57600080fd5b5061014d600160a060020a03600435166103f4565b34801561017c57600080fd5b5061010d60043561042d565b34801561019457600080fd5b5061014d600435610448565b3480156101ac57600080fd5b5061014d60043560243561047e565b3480156101c757600080fd5b506101d360043561057e565b604080519115158252519081900360200190f35b3480156101f357600080fd5b5061010d60043561059b565b34801561020b57600080fd5b506102176004356105c5565b60408051918252519081900360200190f35b34801561023557600080fd5b5061014d6004356024356105d7565b34801561025057600080fd5b50610217600160a060020a0360043516610706565b34801561027157600080fd5b50610217610739565b34801561028657600080fd5b5061014d600435600160a060020a036024351661073f565b3480156102aa57600080fd5b5061010d60043561084d565b3480156102c257600080fd5b5061014d600160a060020a03600435166024351515610868565b3480156102e857600080fd5b506101d3600160a060020a03600435811690602435166108ec565b34801561030f57600080fd5b5061014d600160a060020a036004358116906024351660443560643561091a565b600090815260016020526040902054600160a060020a031690565b60006103568261059b565b9050600160a060020a03838116908216141561037157600080fd5b33600160a060020a038216148061038d575061038d81336108ec565b151561039857600080fd5b6000828152600160205260408082208054600160a060020a031916600160a060020a0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b600554600160a060020a0316331461040b57600080fd5b60048054600160a060020a031916600160a060020a0392909216919091179055565b600a60205260009081526040902054600160a060020a031681565b6040805182815290517f5b6b431d4476a211bb7d41c20d1aab9ae2321deee0d20be3d9fc9b1093fa6e3d9181900360200190a150565b6104883383610a66565b15156104f557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f6e6f20617070726f76616c2f206e6f74206f776e657200000000000000000000604482015290519081900360640190fd5b61057a61051961050483610ac5565b61050d85610ac5565b9063ffffffff610af016565b6040518082805190602001908083835b602083106105485780518252601f199092019160209182019101610529565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040518091039020610b6b565b5050565b600090815260208190526040902054600160a060020a0316151590565b600081815260208190526040812054600160a060020a03168015156105bf57600080fd5b92915050565b60096020526000908152604090205481565b60055460009081908190600160a060020a031633146105f557600080fd5b6105fe8561057e565b151561060957600080fd5b61061e61061585610ac5565b61050d87610ac5565b6040518082805190602001908083835b6020831061064d5780518252601f19909201916020918201910161062e565b51815160209384036101000a600019018019909216911617905260408051929094018290039091206000818152600a9092529290205491965050600160a060020a0316935061069f915086905061059b565b90506106ab8186610ba8565b6106b58286610c30565b8482600160a060020a031682600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a46106ff83610b6b565b5050505050565b6000600160a060020a038216151561071d57600080fd5b50600160a060020a031660009081526002602052604090205490565b60085481565b6060806060600061074f86610ac5565b935061075a85610cb2565b9250610767600854610ac5565b91506107e16107808361050d878763ffffffff610af016565b6040518082805190602001908083835b602083106107af5780518252601f199092019160209182019101610790565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040518091039020610cdd565b90506107ed8582610ce0565b60085460408051888152602081019290925281810183905251600160a060020a038716917f5a3e96f397e68b20a43c25f664b628805b877334dadfcc925c6c1a3ad4340458919081900360600190a2505060088054600101905550505050565b6000908152600a6020526040902054600160a060020a031690565b600160a060020a03821633141561087e57600080fd5b336000818152600360209081526040808320600160a060020a03871680855290835292819020805460ff1916861515908117909155815190815290519293927f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31929181900390910190a35050565b600160a060020a03918216600090815260036020908152604080832093909416825291909152205460ff1690565b60006109263384610a66565b151561093157600080fd5b600160a060020a038516151561094657600080fd5b600160a060020a038416151561095b57600080fd5b600083815260096020526040902054821461097557600080fd5b61097f8584610d3b565b61098b61050483610ac5565b6040518082805190602001908083835b602083106109ba5780518252601f19909201916020918201910161099b565b51815160209384036101000a6000190180199092169116179052604080519290940182900382206000818152600a83528581208054600160a060020a031916600160a060020a038e81169182179092558c83526009855291879020805460010190558a855292840182905285519198508a97509550908b16937fa7894504d84fd9069b3dfd548908287f8c38abc421fd970663f06078f63966d393509181900390910190a45050505050565b600080610a728361059b565b905080600160a060020a031684600160a060020a03161480610aad575083600160a060020a0316610aa284610330565b600160a060020a0316145b80610abd5750610abd81856108ec565b949350505050565b6040805160208082528183019092526060918082016104008038833950505060208101929092525090565b6060806040519050835180825260208201818101602087015b81831015610b21578051835260209283019201610b09565b50855184518101855292509050808201602086015b81831015610b4e578051835260209283019201610b36565b509551919091011594909401601f01601f19166040529392505050565b6000818152600a6020526040902054600160a060020a031615610ba5576000818152600a602052604090208054600160a060020a03191690555b50565b81600160a060020a0316610bbb8261059b565b600160a060020a031614610bce57600080fd5b600160a060020a038216600090815260026020526040902054610bf890600163ffffffff610d9d16565b600160a060020a0390921660009081526002602090815260408083209490945591815290819052208054600160a060020a0319169055565b600081815260208190526040902054600160a060020a031615610c5257600080fd5b6000818152602081815260408083208054600160a060020a031916600160a060020a03871690811790915583526002909152902054610c92906001610daf565b600160a060020a0390921660009081526002602052604090209190915550565b6040805174140000000000000000000000000000000000000000909218601483015260348201905290565b90565b600160a060020a0382161515610cf557600080fd5b610cff8282610c30565b6040518190600160a060020a038416906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b81600160a060020a0316610d4e8261059b565b600160a060020a031614610d6157600080fd5b600081815260016020526040902054600160a060020a03161561057a5760009081526001602052604090208054600160a060020a031916905550565b600082821115610da957fe5b50900390565b600082820183811015610dbe57fe5b93925050505600a165627a7a72305820ab5a7f9846822f401acaecd042db09e989ba185d539b44e336d2dd967a0014c00029000000000000000000000000c33bdb8051d6d2002c0d80a1dd23a1c9d9fc26e4

Swarm Source

bzzr://ab5a7f9846822f401acaecd042db09e989ba185d539b44e336d2dd967a0014c0
Block Age Transaction Difficulty GasUsed Reward
Block Age Uncle Number Difficulty GasUsed Reward