Questions tagged [clarity-lang]

Use in relation to the Clarity smart contract language (part of the Stacks blockchain platform).

Clarity is a language that brings smart contracts to .

It's documentation can be found on the Clarity web page.

Used with the Stacks blockchain.

24 questions
0
votes
1 answer

Start new project, time-locked wallet - Clarity Smart Contracts for Stacks

Going thru the Clarity Code track. When creating a new Project, as you see the time-locked wallet, it didn't create it's own new project column, it went under Counter, the previous project. resulting in timelocked-wallet.clar falling under Counter…
0
votes
1 answer

Clarity Smart Contracts Check if function caller is contract

I have a question .... I have 2 contracts, let's call them contract1 and contract2. Contract1 executes a function that contract2 holds... Is there possible to check if the function caller (tx-sender) is the contract1? I've tried using is-eq or…
0
votes
1 answer

Stacks Clarity Smart Contracts with question mark

Why do some function have a question mark at the end? Like (map-get? ...) I tried using without, but this does not work.
0
votes
1 answer

Stacks Clarity language Post-Conditions

my question is about post-conditions, I dont really understand them. I tried minting NFT's from the sandbox and it has not worked because of post conditions. I also tried minting my own nft on testnet and one contract worked and the other didn't. …
0
votes
0 answers

Verify emitted event on clarinet console

I'm relatively new to clarity smart contract language. I'm trying to emit some data via print method when contract is deployed. Console is showing list of deployed smart contracts, but no event log is there. Sample code is: I'm not sure if clarinet…
0
votes
1 answer

Can not get .bns name from userSession.loadUserData() in React app using the Stacksjs package

I am building an application for the Stacks Blockchain with Clarity smart contract language and Stacksjs on the frontend. From my React UI, I am unable to get the .bns name from the userSession object. From what I researched, it should be under…
0
votes
1 answer

Is there a way to externally listen to (contract-call? ...) calls on a contract?

I have two Clarity contracts (lets call them A and B), and an application that listens to function calls on A, using the @stacks API client. This works fine for when I manually call any function on A (using scripts or the Sandbox, initiating a…
0
votes
3 answers

'clarinet integrate' quickly fails and nothing is logged to console?

Following https://docs.hiro.so/smart-contracts/devnet I can't get the command clarinet integrate to work. I have installed Docker on my mac and am running version 0.28.0 of clarinet. Running command within 'my-react-app/clarinet' where all clarity…
0
votes
2 answers

How to require a true value in Clarity smart contract?

In my smart contract, I want to check whether a boolean value is true, if not the smart contract should abort or throw an error like (begin (require-true value) ...continue ) How can I do that?
1
2