New answers tagged

0

GitHub Action truffle: runs-on: ubuntu-latest defaults: run: working-directory: ./contracts steps: - uses: actions/checkout@v2 - name: Set up NodeJS 12 uses: actions/setup-node@v2-beta with: node-version: '12' - name: Cache npm packages uses: actions/cache@v2 with: path: ./node_modules ...


0

I solved it myself!! ValidationUser.sol: function validAddress( int256 theMsg, uint8 v, bytes32 r, bytes32 s ) public payable returns (bool) { bytes32 hash = keccak256(abi.encodePacked(msg.sender, owner, theMsg)); return isSigned(owner, hash, v, r, s); } function isSigned( address _addr, bytes32 msgHash, uint8 v, ...


0

The problems is that you cannot compare objects with == (since numeric values in javascript do not have enough precision they are wrapped in an BN object). So you have to use the methods provided by the BN library return !ev.value.eq(tokens_sent); The BN library has several methods besides .eq() take a look at their documentation. For backward ...


0

Some things to check Does the message's hash match the signed one? The concatenation in a buffer looks wrong. Does signed message include "Ethereum signed.." prefix? ECRecover doesn't prepend it. Make sure v parameter is either 27 or 28, some libraries return 0 or 1 instead.


2

Related to how to test overloaded function in truffle?, but slightly different with passing a struct. The solution is simple: MyContract.methods['init((address,address,address))'](myStruct)


0

I think if you console.log(ins.address, ans); ... you will find they are the same. If so, the issue is confusion about the instance of the contract that deployed() is using. It is the most recent, on this network, that the deployer knows about, but not necessarily what you expect. It gets updated with each deployer.deploy(). Hope it helps.


Top 50 recent answers are included