Questions tagged [scrypto]

Scrypto is the asset-oriented smart contract language of the Radix network and is designed to become the engine of DeFi.

Scrypto was designed to solve the problems with smart contracts today and to allow the next generation of DeFi products to be developed easily and securely.

Right now, building DeFi functionality is extremely complex. It takes multiple years of learning the language and its edge cases to become "DeFi ready", and even then, there are massive exploits happening every weeks. This is not because of bad developers, but a bad design of the platform and language. DeFi functionality relies massively on assets, but many smart contract platforms doesn't recognize tokens as first-class assets. On Ethereum and every EVM compatible DLTs, developers have to simulate assets by creating smart contracts holding a balance sheet and implement the whole logic of the token (like changing ownership, fetching balance, etc...) themself.

Scrypto solves this issue by making the concept of assets a core feature of the platform itself. Not something else that the developers have to implement themself. This makes developing DeFi functionality extremely simple and more secure.

You can get started learning Scrypto by reading the docs and looking at community-made examples. You can find our developer community on Discord and Telegram

26 questions
0
votes
0 answers

How to send nft to another account in scrypto?

So I have two nft's in my account: { amount: 2, resource address: resource_sim1qfms4etzwnhsdpj5ys9shy9jgv2yp0z9w6ud8z9fyv7svqnjty, ", name: \"mutablenft\""", symbol: \"MNFT\"" } ├─ NonFungible { id: NonFungibleLocalId("#0#"), data:…
kob003
  • 2,206
  • 2
  • 12
  • 19
0
votes
0 answers

How can I deploy a new Scrypto package to the Betanet using an API?

I want to deploy a new version of my Scrypto package to the Betanet but I also want to avoid the manual work doing it through the dashboard. Is there a way to do it through an API so I can automate this process easily? I looked through the…
0
votes
1 answer

Scrypto: how to write test passing bucket as a function argument

In my blueprint, I have a function for the admin to deposit tokens back into the blueprint token vault. pub fn deposit(&mut self, amount: Decimal, mut bucket: Bucket) { assert!(amount <= bucket.amount(), "not enough amount in your bucket"); …
Russo
  • 2,186
  • 2
  • 26
  • 42
0
votes
1 answer

PowerShell: variables in transaction manifest doesn't work

I am trying to run a transaction manifest that contains variables (for example ComponentAddress("${my_account}")) but when I run it with resim run [manifest_file] it doesn't get replaced with the value stored in the environment variables. By the way…
Clement
  • 212
  • 1
  • 8
0
votes
1 answer

ERROR: [ resim publish wasm error] : thread 'main' panicked at 'Failed to instantiate WASM module: Instantiation("Function signature does not match")

I am trying to follow the radix beginner bank tutorial: https://github.com/radixdlt/community-scrypto-examples/tree/main/basic/auction System spec: Windows 11 (64 bit) Editor: VSCode Followed the update guideline mentioned in the repo before…
-1
votes
0 answers

Scrypto: How to mint 10,000 NFTs with JSON metadata?

According to the doc https://docs-babylon.radixdlt.com/main/scrypto/examples/hello-nft.html , we instantiate / deploy NFTs via resim command line tool in Bash. What if I want to mint 10,000 NFTs? I suppose I can use NodeJs or Rust to read each NFT's…
Russo
  • 2,186
  • 2
  • 26
  • 42
-1
votes
2 answers

Radix: How to check token balance in Rust Scrypto test?

I am trying to write a Scrypto test to test my Radix Scrypto smart contract. in Scrypto 0.9.0, the "balance" method shown below has been removed from the Account Component. let manifest = ManifestBuilder::new() .call_method(compo_addr,…
Russo
  • 2,186
  • 2
  • 26
  • 42
-1
votes
1 answer

QUESTION: DIFFERENCE BETWEEN `function` AND `method`

All I know about the difference between them is in the image below. scrypto101 explanantion of function and method I am unable to pinpoint the difference between two of them with complete clarity. Especially, I am unable to see scrypto code and…
-1
votes
1 answer

Error when making calculations with Decimal?

When I try to calculate the fee of something, it wont work. For example if I try: let foo: Decimal = 100.0 * 1.0 I get this error: expected Decimal, found f64 I've tried: let foo: Decimal = 100.0.into() * 10.0.into(); - still doesnt work
-2
votes
2 answers

How can we generate random values in Scrypto?

How can we generate random numbers in Scrypto if floating point libraries are not allowed be used? I want to be able to generate unique IDs for NFTs.
-3
votes
2 answers

Scrypto simulator installtion failure?

I am trying to install the simulator as per the instruction in here. I am getting the following failure message:
kob003
  • 2,206
  • 2
  • 12
  • 19
1
2