Created
January 17, 2022 04:53
-
-
Save tennisonchan/b61df7c149d00754f10cb243f2d26905 to your computer and use it in GitHub Desktop.
This file contains 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
await contract.locked(); // true | |
const pwdInHex = await web3.eth.getStorageAt(contract.address, 1) // '0x412076657279207374726f6e67207365637265742070617373776f7264203a29' | |
const pwd = web3.utils.hexToAscii(pwdInHex); // 'A very strong secret password :)' | |
await contract.unlock(web3.utils.asciiToHex(pwd), {from: player}) | |
await contract.locked(); // false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment