Threads
January 10th, 2022
We have currently 12 threads for the above date.
🛠 │ dev-support
status - Resolved
Evolution --> hi guys trying to follow this basic smart contract deployment tutorial
Evolution --> and in the standard deploy section
Evolution --> it fails when i try to call the set_status method from our contract
Evolution --> https://github.com/near-examples/rust-status-message#standard-deploy
Evolution --> error ExecutionError: `Smart contract panicked: panicked at 'Cannot deserialize the contract state.: Custom { kind: InvalidInput, error: "Unexpected length of input" }', /Users/home/.cargo/registry/src/github.com-1ecc6299db9ec823/near-sdk-3.1.0/src/environment/env.rs:786:46`
Benji | NEAR --> did you deploy multiple contracts to the same account?
Evolution --> yeah i deployed the rust-counter and then i was trying this one
Evolution --> it worked well when i used a dev-account path
Evolution --> but when i tried this path it failed
Benji | NEAR --> check this post out. It’s a similar problem.
Benji | NEAR --> https://stackoverflow.com/questions/70455438/not-all-bytes-read-common-solutions
Evolution --> Thanks let me try
🛠 │ dev-support
status - Resolved
Obedear --> When using the NEAR - NFT Tutorial repo, and your using that contract to mint a collection, how would u keep track of incrementing NFTs being minted?
My thought is you could request the current token ID and metadata from the backend for every mint, would that work?
Benji | NEAR --> I’m confused by your question could you elaborate
Obedear --> I have deployed the NFT tutorial contract and I want users to be able to go into my website and mint an NFT
Everytime a user mints the dApp feeds the contract (NFT 1, Img url: 1, User A).
then when another mints its NFT 2 and img url 2, User B.
My thought is I use a database to store the incrementing Number of what NFT needs to be minted next. Everytime someone mints the dApp sends a request to the backend which hands back what number its up to.
Another option (which I think is how solana does it), is store this incrementing number in the contract and the dApp has the ability to read this value so it knows what token # and img url to give NFT contract next (on solana its stored in an account). This second option is a preferred method tbh.
Obedear --> Essentially can I use a contract to store a number and have a dApp read that number without using a transaction?
Benji | NEAR --> why do you need incrementing token IDs?
Obedear --> for an NFT collection
Benji | NEAR --> you can easily do this within the contract then.
Benji | NEAR --> take the requirement to pass a token ID out
Benji | NEAR --> and then just keep an incrementing number in the contract
Benji | NEAR --> and make that your ID
Obedear --> but then how do I know which image URL to pass it?
Benji | NEAR --> you can still pass in metadata just don’t pass in token ID
Obedear --> All NFTs will have a different metadata though, and I need to keep track of which ones have been passed in and which havnt
Obedear --> Is there a way I can read this incrementing number from the contract in a dApp?
Benji | NEAR --> yea sure just add a view method that returns the incrementing number
🛠 │ dev-support
status - Resolved
Obedear --> where does the contract store this incrementing number?
Benji | NEAR --> you’ll have to store it in the contract struct
Benji | NEAR --> so in state
Obedear -->
Obedear --> like in here?
Benji | NEAR --> yes. I would highly recommend going through the tutorial before starting ur contract so you understand how everything works
Obedear --> will do, just asking some questions before I get into it
Obedear --> Can you call this method without paying gas fees of any kind?
Obedear --> or would it have to be a transaction?
Benji | NEAR --> it’s a view function so yes
Benji | NEAR --> you can call it for free
Obedear --> would an example of that be the nft_supply_for_owner function?
Benji | NEAR --> yes
Obedear --> okay sweet, Im going to go through this tutorial before asking anymore questions for ur sanity’s sake!
Thanks for the help man, I am super stoked to build on some stuff on NEAR. Im coming over from SOL so I am familiar with rust
Benji | NEAR --> awesome! we’re glad to have u 🙂
🛠 │ dev-support
status - Unresolved
padiyar --> Hey everyone, been wanting to explore how the devs can build native mobile apps on near. How to make the frontend library work etc… If there has already been any discussion on this, could someone point me to it?
bucanero --> Native mobile apps built for iOS / Android? I’m not sure if we have such examples, as those would probably require a native library for iOS or Android
🛠 │ dev-support
status - Unresolved
WildDragonDot --> How can I fetch my nft details which is created by using method ‘nft_create_type’ ?
Benji | NEAR --> This isn’t part of the standard so i’m not sure what nft_create_type
does.
🛠 │ dev-support
status - Resolved
nrmmyth --> Is it possible for an contract to create accounts outside it’s hierarchy? For example a contract A.near to create an account B.near or all the accounts have to follow *.A.near path. Thanks!
bucanero --> No, I think the contract can only create sub-accounts on it’s own hierarchy. Perhaps you could have another contract on the “A.near” account and do some cross-contract call, if you really want to create subaccounts on a different near account.
nrmmyth --> "No, I think the contract can only create sub-accounts on it’s own hierarchy."
Could you confirm this? Either way I just want to have a clear messaging towards our users if this is a limitation of network or not.
"Perhaps you could have another contract on the “A.near” account and do some cross-contract call, if you really want to create subaccounts on a different near account."
In your example how would you achieve that A.near creates a C.B.near account?
bucanero --> I confirm that only the parent account can create a subaccount: https://docs.near.org/docs/concepts/account#subaccounts
bucanero --> that also applies to contracts. (the contract on account X, can only create subaccounts on X)
🛠 │ dev-support
status - Resolved
isonar --> Hi devs! Is there any built-in rate limiter in NEAR?
isonar --> I’m developing a small game, and noticed that once I execute some 200 contract calls, I start to get redirected to wallet UI to confirm the transaction…
Yassine --> You might find some answers here: https://github.com/evgenykuzyakov/berryclub/blob/master/frontend/src/App.js#L412
🛠 │ dev-support
status - Resolved
RealHum --> Hello, devs!
We develop a cross-chain solution consisting of two layers:
Part of the infrastructure layer is a self-written scanner based on block parsing.
It is needed to catch the events generated by the contract, process and call the necessary contract functions in another network.
A general description of the scanner’s operation using the example of ether-like networks: we connect to an RPC provider and parse each block for the existence of a contract event.
That is, we ask the scanner to search for a specific event at the address of the contract, which it (the scanner) will look for in each block. When a specific event is found, the corresponding handler is launched.
We are looking for a solution for Near scanning.
Is there already something similar in Near? Maybe someone is ready to help us with this task?
bucanero --> TheGraph recently added support for NEAR. You might want to check it out
Dorian | NEAR --> I made a quick tutorial that breaks down the setup of the Graphs indexer intergeneration into NEAR if you want to check it out.
Zin --> Hi! where can I watch this tutorial?? Please!!
RealHum --> That’s would be great, thanks
Dorian | NEAR --> <@!RealHum> <@!Zin> Here is the writeup I just made! Would actually love your feedback on it if you guys want to go through it. Def let me know if you have questions
I don’t have a video for this yet but if that’s something that interests you I can make one.
Dorian | NEAR --> https://hackmd.io/B3Z81nW6T_iJtadHnVw1pw
Aaron | Vital Point AI --> <@!RealHum> <@!Zin> there’s also this free course for creating subgraphs for NEAR if you want more material: https://vitalpoint.ai/academy/the-graph-near-building-subgraphs/
🛠 │ dev-support
status - Unresolved
eFuze --> Hello, I got a question concerning an error i’ve made making a transaction, who could I turn myself to ?
🛠 │ dev-support
status - Resolved
lilses --> is near-sdk-sim still recommended for testing contracts?
lilses --> i’d imagine so because how else can we get coverage?
Dorian | NEAR --> let me check for you, I think we have something else but I want to make sure what I’m thinking about is for the proper use case
austinabell --> We are transitioning to using workspaces
for testing as it is a quicker and more accurate simulation. We haven’t transitioned examples or deprecated sim tests yet, but they will be in the future.
Rust workspaces: https://github.com/near/workspaces-rs
JS workspaces: https://github.com/near/workspaces-js
And you can use whichever you prefer, they functionally do things very similarly