Last active
July 3, 2019 17:20
-
-
Save andreafspeziale/303017c65a14529aa68ddaa02fe11a46 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const userProxyContractNonce = new BigNumber(await ProxyInstance.nonce.call(user)) | |
const messageToBeHashed = [ | |
ProxyInstance.address, | |
user, | |
TargetContractInstance.address, | |
web3.utils.toTwosComplement(userValueTransactionField), | |
userDataTransactionField, | |
AssetInstance.address, | |
web3.utils.toTwosComplement(REWARD_AMOUNT), | |
web3.utils.toTwosComplement(userProxyContractNonce), | |
] | |
const messageHashed = web3.utils.soliditySha3(...messageToBeHashed) | |
const messageSigned = await web3.eth.sign(messageHashed, user) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment