warp-contracts / warp

An implementation of the Arweave SmartWeave smart contracts protocol.
MIT License
159 stars 44 forks source link

fix: EVM signature verification #286

Closed koonopek closed 1 year ago

koonopek commented 2 years ago
"dependencies": {
    "@apollo/client": "^3.7.1",
    "ethers": "^5.7.2",
    "graphql": "^16.6.0",
    "next": "13.0.5",
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "warp-contracts": "^1.2.30",
    "warp-signature": "^1.0.4"
  },
    "engines": {
    "node": "16.5.0"
  },

Usage:

export function getWarp() {
    const warp = WarpFactory
        .forMainnet()
        .use(new EvmSignatureVerificationWebPlugin());

    return warp;
}

export function getRelationContract(warp) {
    const contract = warp.contract(CONTRACT_TX_ID).connect({
        signer: evmSignature,
        signatureType: 'ethereum'
    });

    return contract;
}

When I run writeInteraction everything works smooth, I sign message using Metamask extension, however when I try to read state with contract.readState this error:

2022-12-02T09:12:57.403Z ERROR [DefaultStateEvaluator] Error: Unable to verify message. Error message: address.toLowerCase is not a function.

occurs in web console (this error occurs per every interaction written).

In version warp-signature@1.0.1 everything works properly!

asiaziola commented 2 years ago

warp-contracts-plugin-signature@1.0.7 should fix the problem.

ppedziwiatr commented 1 year ago

Yo @asiaziola , please remember to close your shit!