Questions tagged [decentralized-applications]

A decentralized application (Dapp, dApp or DApp) is an application that is run by many users on a decentralized network with trustless protocols.

259 questions
0
votes
1 answer

How do I access a plain Ether transaction event in a Solidity Ethereum smart contract dApp?

When a user sends some Ether to a smart contract/dApp address, is there a way I can access that transaction in my smart contract? Like a built-in method that's invoked, that I can add some code to? My ideal work flow, if it's possible: User sends…
pjlangley
  • 364
  • 4
  • 10
0
votes
1 answer

TypeError: ethers.Contract is not a constructor

I am using ethersjs library to create a contract. I used the following line: contract = new ethers.Contract(address, ERC20_ABI, provider); it has worked in the past always but now I am getting the following error: TypeError: ethers.Contract is not…
0
votes
1 answer

How to convert mnemonic to 32 byte seed?

I have a 24-word mnemonic, and I want to convert it to public and private keys. This is how I did it: const hex = HexCoder.instance; final seed = bip39.mnemonicToSeedHex(_mnmonic); final algorithm = Ed25519(); // The hex.decode(seed) have…
0
votes
1 answer

How do I add a custom wallet (cdc defi wallet) to web3modal

I am developing a dapp and am using web3modal to handle the wallet connecting. Metamask shows up by default and WalletConnect is also easy to implement since it's a package easily available for web3modal. The CDC Defi Wallet however is proving to be…
0
votes
1 answer

Moralis Login Using Metamask Problem (Decentralized Application)

I'm working on creating a dApp using Moralis framework. The website is very simple.. I created the html for the login page login.html
0
votes
1 answer

Is there a way to write a custom react hook that can injected into a component?

I have a project that runs when using npm run dev which is next dev in the package.json file since we use the React framework Next.js. When I run npm run build or next build there are multiple errors surrounding React Hooks. Example error in npm run…
0
votes
1 answer

React/Typescript error when adding promise to a function?

I am using the following function from useWagmi to write a transaction to an ethereum contract: https://wagmi.sh/docs/hooks/useContractWrite const [{ data, error, loading }, write] = useContractWrite( { addressOrName: 'Address', …
0
votes
1 answer

Change dapp gateway

How can I change the elrond dapp gateway? I want to use tatum.io in exchange of gateway.elrond.com but with the elrond dapp template https://github.com/ElrondNetwork/dapp-template I don't know how to do it!
paulv
  • 83
  • 2
  • 12
0
votes
1 answer

Why msg.sender has the address of the deployer (address isnt the caller)

I'm currently developing on a simple Naming Service for the Ethereum Blockchain. msg.sender has the address of the deployer from the contract and not from the caller. address public caller; constructor() { caller = msg.sender; …
0
votes
1 answer

Solana web3 js keep gives Cannot read properties of undefined (reading 'negative') while trying to confirm transaction

I'm trying to sign a transaction with connected user's wallet, through phantom but I keep getting this error message Cannot read properties of undefined (reading 'negative') below is my transaction function async SendTransaction(from,to){ …
0
votes
1 answer

ContractObj not found in JavaScript

$(document).ready(function(){ web3c = new Web3(ethereum); const contractAddress="0x6eACA1A0406Def265a1ccbb193e09DA4Fd93635D"; const contractABI= [ { "inputs": [ { "internalType": "string", "name": "messageData", "type":…
Lekshmi
  • 11
  • 1
0
votes
1 answer

How to define listener argument for provider.on(eventName, listener) for listening a smart contract event with ethers.js?

I was following this quick guide to build a Dapp. In order to build the user interface and interact with the smart contract, it uses React. There are the functions below: async function submitBid(event) { event.preventDefault(); if (typeof…
0
votes
1 answer

Why does my console say Truffle(ganache) instead of Truffle(develop)

I'm trying to follow a truffle tutorial and getting stuck. I have made a basic contract and migration script and done the truffle compile and truffle migrate. After this in the tutorials, the command line says "truffle(develop)" whereas mine says…
0
votes
1 answer

Issues with missing ")" after argument list in truffle testing

I am trying to test a solidity contract using truffle test suite and I am unable to fix my code. The error reads " Issues with missing ")" after argument list in truffle testing.". I'd greatly appreciate any feedback or help as I have pretty much…
0
votes
1 answer

Trying to Start React-native with Expo - Tried to register two views with same name RNSVGRect

I was trying to build a React-native dapp using the starter template provided by npx create-react-native-dapp I tried to run it, works fine in the web but when scanning the Expo QR it throws an error Invariant Violation: Tried to register two…
Prakhar
  • 11
  • 4