Common Clarity Errors

Ayush Sahu
2 min readSep 15, 2021

--

Here are a few errors that I came across while doing Clarity development, and their resolutions. I will keep updating this list as I encounter novel errors.

— — — — — — — — — — — — — — — — — — — — — — — — — —

Parsing error: Failed to lex input remainder: ‘’ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM.timelocked-wallet lock ‘STNHKEPYEPJ8ET55ZZ0M5A34J0R3N5FM2CMMMAZ6 u1000 u100)’

This one’s not on you. You probably have a different clarity-repl version from the tutorial that you may be following. I resolved it using this syntax.

>> (contract-call? .timelocked-wallet lock ‘STNHKEPYEPJ8ET55ZZ0M5A34J0R3N5FM2CMMMAZ6 u1000 u100)

— — — — — — — — — — — — — — — — — — — — — — — — — —

Use of unresolved function

You probably have a constant enclosed in parantheses which shouldn’t be. Set it free.

— — — — — — — — — — — — — — — — — — — — — — — — — —

Analysis error: expecting expression of type 'optional' or 'response', found 'uint'

This is quite clear. Still, looks like you have used a uint where an ‘optional’ or a ‘response’ was expected. Optional and Response both are datatypes, which you ought to know about. Read about them here: https://book.clarity-lang.org/

— — — — — — — — — — — — — — — — — — — — — — — — — —

Use of unresolved contract

Probable error in Clarinet.toml. Look for missing dependencies. Dependencies of contracts on other contracts have to be explicitly mentioned.

Check if you can run clarinet console. If yes, then the error is on VSCode’s part.

— — — — — — — — — — — — — — — — — — — — — — — — — —

Use of undeclared trait

Again probable error in Clarinet.toml. May have to do with wrong naming of files.

Check if you can run clarinet console. If yes, then the error is on VSCode’s part.

— — — — — — — — — — — — — — — — — — — — — — — — — —

More to come.

--

--

Ayush Sahu
Ayush Sahu

No responses yet