Advertisement
Guest User

Untitled

a guest
Mar 25th, 2019
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. contract Test {
  2.  
  3. bytes32 public byteValue;
  4. uint96 public unInt96;
  5. uint public unInt;
  6. address public unpackedaddress;
  7. bytes public bye;
  8.  
  9.  
  10. //0x5818a1f456bfeee4683bb3a8235dc2f365670f56
  11. //23
  12. //bye = 0x5818a1f456bfeee4683bb3a8235dc2f365670f560000000000000000000000000000000000000000000000000000000000000017
  13. function getByte(address add,uint amount) public{
  14. bye = abi.encodePacked(add,amount);
  15. byteValue = getBytes32FromByte(bye);
  16. unInt96 = uint96(byteValue);
  17. unInt = uint(unInt96);
  18. unpackedaddress = address(byteValue >> 96);
  19. }
  20.  
  21. //yes = 0x5818a1f456bfeee4683bb3a8235dc2f365670f56000000000000000000000017
  22. function getTat(bytes32 yes) public{
  23. unpackedaddress = address(yes >> 96);
  24. unInt = uint(uint96(yes));
  25. }
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement