Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- contract Test {
- bytes32 public byteValue;
- uint96 public unInt96;
- uint public unInt;
- address public unpackedaddress;
- bytes public bye;
- //0x5818a1f456bfeee4683bb3a8235dc2f365670f56
- //23
- //bye = 0x5818a1f456bfeee4683bb3a8235dc2f365670f560000000000000000000000000000000000000000000000000000000000000017
- function getByte(address add,uint amount) public{
- bye = abi.encodePacked(add,amount);
- byteValue = getBytes32FromByte(bye);
- unInt96 = uint96(byteValue);
- unInt = uint(unInt96);
- unpackedaddress = address(byteValue >> 96);
- }
- //yes = 0x5818a1f456bfeee4683bb3a8235dc2f365670f56000000000000000000000017
- function getTat(bytes32 yes) public{
- unpackedaddress = address(yes >> 96);
- unInt = uint(uint96(yes));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement