Questions tagged [rsk]

Rootstock is the first general purpose smart contract platform secured by the Bitcoin Network. The Rootstock network is highly compatible with the Ethereum network at various layers. Rootstock is the Smart Contract platform of Bitcoin. Its engine is a forked version of the EVM (Ethereum Virtual Machine), and the RVM (Rootstock Virtual Machine) is compatible with Ethereum Smart Contracts and the tools used to deploy and interact with them.

Rootstock () is an Ethereum-compatible smart contract platform, secured by the Bitcoin network.

Developers can rely on their existing skills and familiar tools, working with Ethereum, when developing on RSK because:

  • The virtual machine is EVM compatible;
  • Interprocess connectivity is JSON-RPC compatible;
  • Smart contract programming language - Solidity is supported; and
  • Javascript programming interface - web3.js is supported.

See Rootstock Dev Portal for developer documentation.

The Rootstock blockchain is secured by merge-mining, with some additional security measures. The Rootstock blockchain is mined by the Bitcoin miners. It also features a 2-way peg, which has methods to transfer BTC into RBTC and vice-versa. See Rootstock FAQs.

78 questions
14
votes
3 answers

How to find out in advance the address of the smart contract I am going to deploy?

I have a Solidity smart contract ContractFactory which I am deploying on RSK and developing in Hardhat. ContractFactory has a deploy function which produces new Child smart contracts. ​ // SPDX-License-Identifier: MIT pragma solidity…
Owans
  • 1,037
  • 5
  • 14
12
votes
3 answers

What to do about "transaction nonce too high" errors in RSK?

I have a decentralised application deployed on RSK, and has been working for several months. Everything works correctly using the public node, however infrequently, we start getting a totally random error: Unknown Error: { "jsonrpc": "2.0", …
7alip
  • 895
  • 6
  • 11
10
votes
3 answers

How to limit token receiver callers to accepted token address?

I want to create a payable token which includes a function transferAndCall(TokenReceiver to, uint256 amount, bytes4 selector). By calling this function, you can transfer tokens to the TokenReceiver smart contract address, and then call…
Aleks Shenshin
  • 2,117
  • 5
  • 18
10
votes
2 answers

How to receive a value returned by a Solidity smart contract transacting function?

I am writing an NFT smart contract which I am going to test via Hardhat and deploy on RSK. //SPDX-License-Identifier: Unlicense pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; contract MyNFT…
Ahsan
  • 339
  • 3
  • 11
10
votes
2 answers

How can I calculate the average gas cost per a transaction on RSK?

I want to calculate an average gas fee paid for all transactions on the RSK within the last three months. I tried to query the RSK blockchain using the Web3.js library. To get transaction data for just a single block height, I had to do: const…
Irene Patrikios
  • 249
  • 1
  • 5
10
votes
1 answer

What is the Solidity interface for the RSK Bridge smart contract?

The RSK Bridge exposes its interface through a smart contract deployed at 0x1000006. I was able to find the ABI file for the Bridge on github. I'm after a Solidity interface file instead - is there one available, and if so where can I find it?
7alip
  • 895
  • 6
  • 11
10
votes
4 answers

How can I find out the number of times an RSK transaction has been confirmed on the RSK blockchain?

It would be good to know how many times a transaction has been confirmed on the RSK blockchain so that when one user sends RIF to another wallet or to an exchange wallet for example we can see how many confirmations have occurred
eddyshanghai
  • 111
  • 3
9
votes
1 answer

How to expose RSK node to an external network?

I am having problems exposing my RSK node to an external IP. My startup command looks as follows: java \ -cp $HOME/Downloads/rskj-core-3.0.1-IRIS-all.jar \ -Drsk.conf.file=/root/bitcoind-lnd/rsk/rsk.conf \ -Drpc.providers.web.cors=* \ …
Aleks Shenshin
  • 2,117
  • 5
  • 18
9
votes
1 answer

How to advance block number when I’m developing on RSK Regtest?

I have a smart contract that checks if the actual block number is higher than a fixed one to execute certain functionality and I need to write a unit test to validate that behavior. I’m using RSK in Regtest mode to execute tests and I would need to…
Owans
  • 1,037
  • 5
  • 14
8
votes
3 answers

Call solidity function dynamically, based on its bytes4 function selector

In a smart contract, let's say I have a function which wants to invoke another function dynamically, based on some internal logic. Here it obtains the function selector as a bytes4 variable. After which it is possible to use branching logic to…
bguiz
  • 27,371
  • 47
  • 154
  • 243
8
votes
1 answer

How can I configure Hardhat to work with RSK regtest blockchain?

I intend to develop my smart contracts in Hardhat, and to test them on RSK regtest local node. I was able to find a Truffle regtest configuration. development: { host: "127.0.0.1", port: 4444, network_id: "*" }, What hardhat.config.js…
Gino Osahon
  • 399
  • 1
  • 6
8
votes
1 answer

Can I use the block height to measure the passage of a year based on the average block time in RSK and Ethereum?

I want to build a Solidity smart contract in RSK and Ethereum that pays dividends every year. Should I use the block time or can I rely on the block number, assuming a the current average inter-block time in RSK and Ethereum?
Sergio Lerner
  • 216
  • 1
  • 4
8
votes
2 answers

How to use personal_sendTransaction on RSK?

I'm running an RSK node and I'm trying to send a transaction using personal_sendTransaction but I get this error: The local wallet feature is disabled How can I fix this? thanks in advance
Dul
  • 81
  • 3
7
votes
2 answers

How to connect Metamask to Rootstock networks?

I am building a DApp which connects to Rootstock Testnet and Mainnet via MetaMask. Unfortunately, I didn't find Rootstock among the available networks out of the box in MetaMask. ​ In this tutorial I found the information on how to manually add…
Jeremy Then
  • 525
  • 2
  • 12
7
votes
1 answer

How to deploy two smart contracts consequently on RSK via Hardhat?

I am developing two smart contracts whose deployment order matters. First comes an ERC20 token, and then its deployment address should be passed to an ERC721 smart contract's constructor. Both contacts interaction was successfully tested on Hardhat.…
1
2 3 4 5 6