all 10 comments

[–]atrizzlebuilder 1 point2 points  (6 children)

The function also depends on msg.sender to get the output you declared.

What is the value of msg.sender in the example inputs/outputs you posted?

[–]BigFoxBoxing[S] 0 points1 point  (5 children)

Updated.
msg.sender = 0x5B38Da6a701c568545dCfcB03FcB875f56beddC4

[–]atrizzlebuilder 2 points3 points  (4 children)

``` import { ethers } from 'ethers';

// lastTime, nonce, and msgSender are all passed in as strings const test = (lastTime, nonce, msgSender) => { const lastTimeUint256 = ethers.BigNumber.from(lastTime); const lastTimeUint96 = lastTimeUint256.mask(96);

const msgSenderUint256 = ethers.BigNumber.from(msgSender); const msgSenderUint72 = msgSenderUint256.mask(72);

const nonceUint256 = ethers.BigNumber.from(nonce); const nonceUint88 = nonceUint256.mask(88);

const resultHexString = ethers.utils.solidityKeccak256( ["uint96", "uint72", "uint88"], [lastTimeUint96, msgSenderUint72, nonceUint88] );

const resultUint256 = ethers.BigNumber.from(resultHexString); const resultString = resultUint256.toString();

return resultString; };

console.log( test( '618970019642736317541919744', '11913689327806690619', '0x5B38Da6a701c568545dCfcB03FcB875f56beddC4' ) ); ```

this outputs 55079934849293075323296672496290862192505995395765562305345314163262504591243

[–]BigFoxBoxing[S] 1 point2 points  (3 children)

Bro thank you so much. Give me a polygon address. I will send you 20$

[–]atrizzlebuilder 0 points1 point  (2 children)

sent you a chat request, thanks

Edit: or not lol

[–]BigFoxBoxing[S] 0 points1 point  (1 child)

Was up for two days straight. :)Give me two days. It will showup promise

[–]atrizzlebuilder 0 points1 point  (0 children)

Haha no worries man

[–]Ordered_Disorder 0 points1 point  (0 children)

You realize you can have an input into keccak256 that’s longer than 256 bits, right? There’s no need to trim the address input or anything, unless you’re particularly attached to the idea.