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
5
votes
2 answers

How to connect useDApp to Rootstock networks?

I am creating a React.js DApp which will interact with Rootstock (RSK) deployed smart contracts. Recently I came across a React library called useDApp. This library automates the blockchain connection, smart contract interaction and sending…
5
votes
2 answers

How to aggregate multiple smart contract function calls on Rootstock?

I have multiple ERC20 tokens, deployed on Rootstock, and I want to track their balances and allowances in a real time from my DApp. In ethers.js, I can track their balances by alternately calling the functions balanceOf(address) and allowance(owner,…
bguiz
  • 27,371
  • 47
  • 154
  • 243
5
votes
1 answer

How can I choose my own smart contract addresses on RSK before deploying it?

I have noticed that some smart contracts have addresses that start with 0x0000, 0x1234, or0x1337 - and I'm not sure how the deployers managed to do this. ​ Is it possible to do this on RSK?
Irene Patrikios
  • 249
  • 1
  • 5
5
votes
1 answer

Why does an event emitted by a smart contract function called via `delegateCall` disappear?

I have two interacting smart contracts that I am developing/testing in Hardhat and deploying to RSK: DelegateCallee smart contract with a getData() function, emitting a Received event: contract DelegateCallee { event Received(address sender,…
Aleks Shenshin
  • 2,117
  • 5
  • 18
5
votes
2 answers

How to decode bytes calldata in a smart contract?

I have 2 interacting smart contracts which I am developing/testing in Hardhat and deploying to RSK. One of them is an ERC1363 payable token with transferAndCall(address,uint256,bytes) function, and the second one is a token receiver whose…
Aleks Shenshin
  • 2,117
  • 5
  • 18
5
votes
2 answers

How to test the Solidity fallback() function via Hardhat?

I have a Solidity smart contract Demo which I am developing in Hardhat and testing on the RSK Testnet. //SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.0; contract Demo { event Error(string); fallback() external { emit…
Aleks Shenshin
  • 2,117
  • 5
  • 18
5
votes
1 answer

Is it possible to top up smart contract's balance at the time of its deployment?

Say I have a Solidity smart contract MultiToken.sol which I am developing and testing using Hardhat and deploying to the RSK network. ​ //SPDX-License-Identifier: Unlicense pragma solidity ^0.8.0; ​ import…
5
votes
1 answer

How to generate matching RSK accounts from a seed phrase on Hardhat?

I have followed this Hardhat tutorial. But I'm modifying the config file to make it work on RSK, and have uencountered some unexpected behaviour with addresses. ​ const { expect } = require('chai'); ​ describe('Token contract', () => { …
5
votes
2 answers

How to test RSK testnet deployed smart contracts via Hardhat?

I am using Hardhat to deploy and test my smart contract on RSK testnet. This is the hardhat.config.js setup I am using: require('@nomiclabs/hardhat-waffle'); const mnemonic = fs.readFileSync('.mnemonic', 'utf8').toString().trim(); const…
Irene Patrikios
  • 249
  • 1
  • 5
5
votes
1 answer

How to run RSKj tests?

I have cloned RSKj from the official repo and trying to run the test folder on IntelliJ. I am running the last Java version on an M1 MAC. I'm having the following error when running the tests on the master branch. Unable to make private static…
Gino Osahon
  • 399
  • 1
  • 6
5
votes
1 answer

How can I configure Hardhat to connect to RSK Testnet?

To connect to an Ethereum Testnet, the configuration in hardhat.config.js is like this: networks: { ropsten: { url: `https://eth-ropsten.alchemyapi.io/v2/${ALCHEMY_API_KEY}`, accounts: [`${ROPSTEN_PRIVATE_KEY}`] } } (taken…
Aleks Shenshin
  • 2,117
  • 5
  • 18
5
votes
1 answer

How to find out gas fees paid for the latest transactions of a token on RSK?

I want to query the Covalent database to find out the amount of gas paid out in the latest 100 rUSDT token transfer transactions on the RSK blockchain. In the following SQL query I am trying to join these two tables to find out the gas fees paid for…
serlokiyo
  • 353
  • 1
  • 9
5
votes
1 answer

How to fix LevelDB library load error when running RSKj node on a Windows machine?

I am trying to run RSK blockchain node RSKj on a Windows machine. When I run this line in a terminal: C:\Users\yemode> java -cp C:\Users\yemode\Downloads\Programs\rskj-core-3.0.1-IRIS-all.jar co.rsk.Start the RSKj node starts running, but I get…
Aleks Shenshin
  • 2,117
  • 5
  • 18
5
votes
2 answers

Is there a way for smart contract on RSK to fetch on-chain data from Bitcoin network without using oracles?

Is there a way for smart contract on RSK to fetch on-chain data on Bitcoin not depending on trusted oracles? I just found a proposal called Open Bitcoin blockchain oracle (RSKIP220) which will be implemented from the IRIS upgrade but couldn't find…
Jack
  • 121
  • 4
5
votes
1 answer

How can I get info such as symbol of an ERC20 token on RSK?

I would like to query several ERC20 tokens on the RSK network to obtain the following fields: symbol, name, and decimals. How can I do this using web3.js?
Milton
  • 161
  • 1
  • 4