Smart contracts also known as a smart property are computer protocols that facilitate, verify, or enforce the negotiation or performance of a contract, or that make a contractual clause unnecessary.
Questions tagged [smartcontracts]
3050 questions
0
votes
1 answer
Where can I find a list of all operations possible on lists and maps for Clarity Smart Contracts?
Is there a resource for Clarity Smart contracts on Stacks that contains all operations possible on lists and maps?
for instance for lists, I see in the book that you can append but can you also remove elements?
I am not sure whether this is also…

Rick
- 1
0
votes
1 answer
Clarity Smart contract validate principal calling public function
When writing a Clarity Smart contract, how can you validate the principal that is calling into a public function.
I don't know where to find the answer to this question.
0
votes
1 answer
Define Non Fungible Token - Stacks Clarity Smart Contract
Question, the two functions "define-non-fungible-token" and "define-trait" are unrelated... right? The function "define-non-fungible-token" is used to create an NFT. While the function "define-trait" is used so that another contract can utilize that…

Brian
- 11
- 1
0
votes
1 answer
Define functions expression - Clarity Smart contract Stacks
The expressions that define functions take one expression for the function body.
[The function body is what is executed when the function is called.]
If the body is limited to one expression only, then how can you create more complex functions that…
0
votes
1 answer
Running Clarity Smart Contracts u0 u1 u2 function
If I run the following:
(define-data-var even-values uint u0)
(define-public (count-even (number uint))
(begin
;; increment the "event-values" variable by one.
(var-set even-values (+ (var-get even-values) u1))
;; check if the input…

Brian
- 11
- 1
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…

Brian
- 11
- 1
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…

Rick
- 1
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.

Brian
- 11
- 1
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
2 answers
MetaMask - RPC Error: The requested account and/or method has not been authorized by the user
I am trying to buy an NFT on OpenSea, when executing the fulfillOrder() method, I get an error saying The requested acconut has not been authorized by the user.
This is my code where I initialize the web3 provider and stuff:
this.web3 = new…

toekneema
- 137
- 1
- 2
- 7
0
votes
0 answers
How to pass a structure as an argument to the smart contracts function with Web3j?
I’m trying to pass a simple structure as an argument to smart contracts function.
struct Fee {
uint16 rate;
address payable recipient;
}
As I understood I have to do it through a tuple.
In this case my tuple has type Tuple2
0
votes
7 answers
Contract undefined in thirdweb-dev/react
I am using thirdweb-dev/react to communicate with smart contract but the issue is it is giving me the contract undefined in my code with this error.
query.ts:444 Error: Could not resolve metadata for contract at…

Zain Sahi
- 123
- 8
0
votes
0 answers
Pass to smart contracts function an array of tuples with Web3j
I’m trying to call a smart contracts function which gets “tuple []” as an argument.
Each tuple represents a Fee object in the smart contract
struct Fee {
uint16 rate;
address payable recipient;
}
I don’t understand how to specify this data…

Slava Brall
- 7
- 1
0
votes
1 answer
Errors in hardhat.config.ts configuration file
I'm following this Alchemy tutorial on how to deploy a smart contract on the Sepolia testnet. When I try to compile my smart contract, I get these errors:
Error HH8: There's one or more errors in your config file:
* Invalid value undefined for…

Han
- 171
- 2
- 2
- 7
0
votes
1 answer
How can I send tokens to number of addressess in a single transaction?
I'm having trouble sending tokens to many addresses simultaneously. So I have to make one tx for each recipient, it take a lot of time and i have to wait for next transaction.
Can someone help me how to do…

Ashwani Kashyap
- 31
- 3