Elrond team continuously releases smart contract examples/open source smart contracts which are either just for showing good practices or for their own usage
dmn8392211779 activity
dmn8392211779 commented on If user creates collection first on nft marketplace site, nft minter smart contract is deployed or only call create collection function?
That depends on how the market implements that on their end. I don't think the markets use exactly the elrond nft minter sc from github
dmn8392211779 commented on And is it easy to connect maiar wallet in our app? Means how it wallet connectivity with backend and frontend?
Moreover, you have this template from which you can start: https://github.com/ElrondNetwork/dapp-template
dmn8392211779 commented on And is it easy to connect maiar wallet in our app? Means how it wallet connectivity with backend and frontend?
It's not very hard. If you use React and want an even simpler solution you can use this package: @elrondnetwork/dapp-core
dmn8392211779 commented on Why would you think that to_vec is to expensive?
I know at some point I had a conversation here where Dorin said to_vec is very expensive and shouldn't be used unless absolutely needed. Maybe I got it wrong
dmn8392211779 commented on Are you giving the fungibleFromAmount a number or a string?
Number, I think. I'll have to check again
dmn8392211779 commented on Can use use structs defined in the other contract?
If you defined them identically in your current contract, yes, as far as I know
dmn8392211779 commented on Hey! My question may be broad, so if it's too vague to answer I'll come back with it more nuanced after studying the Farm Staking SC. Here it is: How does the DEX Farm Staking SC take into account the total value staked by users in order to modify the APR?
Or a bit more specific: how does the sc "know" to give you a specific apr between two blocks and another one between another two blocks (depending on the total value staked)
dmn8392211779 commented on Hi! Is there any way in which you can get the value of EGLD in USDC in an SC?
So? No way of maybe getting the USDC price of EGLD through the DEX SC?
dmn8392211779 commented on I guess that's because the sc function is #[payable("EGLD")] and I'm not sending any transaction value?
You need to put * instead of egld
dmn8392211779 commented on hmm, I have a situation where I need to wrap egld before making a call. is there a way to make 2 transactions but the second one to wait for 1st to finish?
I think the best way to do it would be to make the transaction internally in your SC. Let the user send egld, wrap it up yourself in sc then use that in your other processes
dmn8392211779 commented on It works fine. Check the obvious first. Are you on the pem tab when you upload the file? Try regenerating the pem?
Yea, I am. I will make a video
dmn8392211779 commented on Also I'm trying to run this elrond template(https://github.com/ElrondNetwork/dapp-template), but having errors too, anyone who can help please?
https://stackoverflow.com/questions/37826449/expected-linebreaks-to-be-lf-but-found-crlf-linebreak-style
dmn8392211779 commented on Hi guys! Is there a way to get current epoch from erdjs & erdpy?
You can use this endpoint: https://api.elrond.com/stats
dmn8392211779 commented on Hi! Anybody knows which would be the easiest way to executed some code right after login when using any of the dappcore LoginButtons?
was able to do it using a useEffect tied to the address obtained from getAccountInfo()
dmn8392211779 commented on Hi guys! So I was wondering if anyone has gone into iterating over big dictionaries ( MapMappers) I was wondering what you would think would be more efficient. So let's say we have a MapMapper containing 100.000 entries and it looks something like . You need to iterate through a... Read more
From what I know, there is quite simply no reasonable way to iterate over those 100K entries and be ok in terms of gas consumed. Mostly what you can do is split the iteration into more transactions or find a way to avoid that iteration
dmn8392211779 commented on What is the easiest way to compare two lists of addresses (snapshots) and extract only the elements that are in both lists?
You could in theory create a script that does that in your programming language of choice as that is a string parsing problem in itself, not directly an Elrond problem. I'd choose Python :)
dmn8392211779 commented on And what about your sdk mean? Which are written in c# or js.. What is the propose of it?
The roles of the C# and JS SDKs is to create apps or scripts that interact with the blockchain, but not to create smart contracts
dmn8392211779 commented on Hello .. In what programming language does the elrond blockchain work?
Hi! Smart Contracts are written mainly in Rust. You mainly use JS for frontend interaction with smart contracts. And there are some other languages you can also use for different stuff. For instance I use python for scripts
dmn8392211779 commented on can i find somewhere some code examples for a marketplace? does anyone know or is willing to share such SCs?
You can use whatever ESDT Token you want in your smart contract
dmn8392211779 commented on Hey there! Anybody can explain what exactly happens when the owner of an NFT wipes that NFT?
So, seems like the burn and wipe functions either do not work as desired or the documentation explains what they do in a wrong way. In the documentation it says that the burn function should be used for SFTs to delete them and that the wipe function is the equivalent for nfts. But it seems when used on an nft, the wipe function just makes the nft disappear from the wallet, but when looking through the api you can still see the nft as being of the owner before the wipe. Moreover, the burn function works on nfts. the burn function actually did what I wanted it to do and made the NFT disappear from everywhere
dmn8392211779 commented on sometimes "Rejected By User" error occurred with web wallets does anyone know the reason or a solution?
I get that, too, specifically when using erdjs 10 and web wallet with Maiar
dmn8392211779 commented on Here is my use case: I want to keep a list of unique numbers and once in a while (every week for example) an endpoint is called to draw a random number from the previous list. The list is then entierly cleared. I thought SetMapper would be the best choice for this usecase. Am I mistaken?
Seems like you can do just fine with a VecMapper
dmn8392211779 commented on how do you do that?
let vec: Vec
dmn8392211779 commented on Hi devs there is a way to generate ABI file from the smart contract source code ? Or at least a basic file with function names ?
When you compile an sc you also have the abi in the output folder
dmn8392211779 commented on Can somebody please help me understand gas usage and refunds. In all of my SC calls I see a red warning - (example) "@too much gas provided for processing: gas provided = 59931999, gas used = 2210209" And at the same time "Gas Used 59,999,999" In other transactions that I saw in explorer I see that... Read more
Extra gas is sent back if you are sending up to 10x the gas fee (or 5x, not sure)
dmn8392211779 commented on Guys, my friend has an issue connecting to his wallet from web on mobile. He’s using android and Google chrome. Whenever he clicks to login with maiar from maiar exchange it opens Google store instead of the app. Are you familiar with this issue?
This is generally happening if the app does not "detect" that Maiar is installed. It is happening a lot on privacy focused browsers such as Brave or even Maiar Browser
dmn8392211779 commented on Is there any easy way to drop thousands of NFTs to lots of addresses?
Not a direct one. You would have to code it
dmn8392211779 commented on but simulating the transaction everytime before i send the actual transaction?
No, simulate it once and you should be good unless your SC state changes drastically from each tx
dmn8392211779 commented on Currently i am passing hard coded gas value 50million, but is there any good way to calculate?
A non technical way is to estimate how much you need based on past transactions. You usually want to send x2 or something of that
dmn8392211779 commented on Hi, I have a problem. We just created an SFT that we want to distribute and people will be able to burn and claim a reward. The thing is that the SFT was tagged as "scam" by Elrond and it doesn't show in the Maiar app. Any idea how can we fix that?
I have observed the scam warning sometimes happens if you accidentally forget to hex encode data when creating the SFT or if you accidentally put a link somewhere where it shouldn't normally be (putting it in the attributes for example)
dmn8392211779 commented on Do you know by any chance if I can get an item by index in a setmapper?
Or even better if anybody has any idea how you can get a random item from a SetMapper
dmn8392211779 commented on Hey! Can you use callback functions for non-asynchronous calls?
I am not sure tbh?
dmn8392211779 commented on Hello guys!! Let’s say contract A calls a method of contract B. Is there a way to know the tokens that contract A received as a result of this call?
I think you can do so using a call back function
dmn8392211779 commented on Anybody knows how to give the egld token identifier as argument in transaction?
Ohh? it's EGLD