3,051 questions
1
vote
1
answer
45
views
Why does my ERC20 contract revert when calling transferFrom?
I'm writing an ERC20-based contract in Solidity 0.8.21.
When I call transferFrom, the transaction reverts even though the allowance and balance are sufficient.
Here’s a simplified example:
function ...
0
votes
0
answers
60
views
Hardhat3: How to deploy smartcontract in script on localhost?
I'm playing with a simple project of issuing ERC20 token. Following the example in hardhat3 doc, I successifully deployed the contract on localhost with CLI as below:
run local blockchain npx hardhat ...
0
votes
0
answers
74
views
Call Sui Move contract from my own contract, maybe version collision
I’m trying to call the Bluefin contract from my own contract.
Bluefin contract: https://suiscan.xyz/mainnet/object/0x5d029d551d589105a9589e47ef75ffaa43e6d9d1d844745867db2a56e18f65e1/contracts
The ...
0
votes
2
answers
81
views
using dazl to access daml sandbox. how can i listen to events on ledger?
I am trying to create a dazl script that would listen to events on locally run daml sandbox, and upon catching an event, process it (with my bus. logic). AI gives me a bunch of suggestions that fail ...
0
votes
1
answer
63
views
Contract deployed successfully on Hedera Testnet, but has no code. Script works for anvil
I have the following deploment script:
require('dotenv').config();
const { ethers } = require("ethers");
const fs = require("fs");
const path = require("path");
const ...
2
votes
0
answers
103
views
How does Sui’s one-time witness (OTW) guarantee single initialization at the protocol level?
Sui Move’s one-time witness (OTW) pattern ensures a module’s init function runs exactly once.
From Move documentation
The OTW is a special type of Witness that can be used only once. It
cannot be ...
1
vote
0
answers
35
views
Experiencing error when Testing Raffle smart Contract
I'm working on testing a Chainlink VRF-based Raffle contract using Foundry, but I’m encountering a EvmError: Revert when running the test that checks whether the raffle correctly blocks entries while ...
0
votes
2
answers
84
views
How to declare the 'types' argument to `Eth::Abi.decode` to parse the response of a Solidity function that returns a single struct
I am using eth gem to interact with a Smart Contract in EVM.
The Smart Contract has a function whose ABI in JSON format is this:
{
"inputs": [
{"internalType": "...
1
vote
0
answers
68
views
Why does my Hardhat test fail with Transaction reverted after using evm_increaseTime?
I’m testing a Solidity smart contract for a project. A user buys a short-term policy that expires in 5 seconds. After advancing blockchain time by 10 seconds, I try to call claim(), but the ...
2
votes
1
answer
84
views
How do you do deploy a smart contract in native mobile app using Dart or Flutter (without using a webview)?
I know how to do this in Javascript with web3.js, but I don't know how to do this from a native mobile app written in Flutter/Dart.
I have seen references for people having done this with web3Dart. ...
0
votes
0
answers
72
views
Error: cannot estimate gas; transaction may fail or may require manual gas limit [See: https://links.ethers.org/v5-errors-UNPREDICTABLE_GAS_LIMIT]
I have written test cases for the Bridge smart contract, which uses LayerZero for cross-chain communication. However, when I set up the Hardhat project and attempted to run the test cases, I ...
1
vote
0
answers
40
views
Calling the ethereum EIP-4788 contract from go
I am trying to call the EIP-4788 contract from go. For development, I am using the Sepolia testnetwork. I have a local beacon chain client running connected to a geth instance running on the Sepolia ...
0
votes
1
answer
87
views
Smart contract is not deployed in my current network?
I'm new to blockchain. I setup a ganache network, added it to metamask. I'm trying to start an npm server and it works. On npm start, I'm being redirected to localhost:3000, where there are 4 options. ...
1
vote
1
answer
46
views
Can hashing be done in compact on the client side using persistentHash?
I'm using Midnight and learning compact. I'm hoping to get some clarification on the persistentHash function (export declare function persistentHash<a>(rt_type: CompactType<a>, value: a): ...
0
votes
0
answers
128
views
Solana Anchor - Test Failed Error: Building IDL failed
I'm working on a Solana Anchor project and I'm running into a cryptic error when trying to run my tests:
Finished `_test` profile [unoptimized + debugging] target(s) in 10.14s
Running Unittests src/...
0
votes
1
answer
61
views
Chainlink VRF: Created Subscription ID Mismatch Between On-Chain and Dashboard
I'm encountering an issue where the subscription ID returned by my script is different from the one shown on vrf.chain.link for the Sepolia network, which when i try to fund to the subid from my ...
1
vote
1
answer
51
views
Is it expected for typescript target files generated by compactc to be empty?
I'm learning Midnight's tooling and compact language. I currently have two contracts:
a.compact:
module a {
export sealed ledger num: Uint<8>;
}
b.compact:
import "a";
constructor(...
0
votes
0
answers
46
views
Can I implement a tax deduction feature in an ERC20 contract where the tax is deducted in BNB or ETH when a user swaps tokens on PancakeSwap?
The _transfer() function only handles ERC20 token transfers, so I can't implement any logic for ETH or BNB within it.
I integrated some functions, but they were not callable on PancakeSwap. When I ...
1
vote
0
answers
21
views
Error in adding a struct containing a mapping in an array in solidity
I am new to Solidity and am trying to add a struct containing a mapping to an array. However, this fails. When I run this on Remix I get a message transact to CampaignFactory.createCampaign pending ......
1
vote
0
answers
57
views
Uniswap V3: Unable to Add Liquidity After Deploying ERC20 Token with Tax Mechanism
I am trying to add liquidity to Uniswap V3 for my ERC20 token, which has a 4% tax deduction on transfers. The tax mechanism ensures that whenever users transfer tokens, 4% is sent to the owner's ...
0
votes
1
answer
80
views
I am unable to swap the token after adding liquidity to Uniswap V2
I have deployed an ERC20 contract on the Sepolia chain and added liquidity on Uniswap V2. However, when I tried to swap the token with ETH, the token price was not being calculated, and I was unable ...
1
vote
1
answer
88
views
Risc Zero Proof Verification Fails On-Chain but Works Off-Chain
I am working on a smart contract that uses Risc Zero to verify proofs generated from a Rust program. I have successfully generated the seal, imageID, and journalDigest from the Risc Zero Rust program. ...
0
votes
0
answers
51
views
Buy Operation for Jettons Results in Normal TON Transfer Instead of Token Purchase
I'm working on a script to purchase Blum tokens using the TEP-74 Jettons standard, but instead of triggering the buy operation, the transaction is being processed as a normal TON transfer. Below is ...
0
votes
1
answer
51
views
Error: cannot estimate gas; transaction may fail or may require manual gas limit [ See: https://links.ethers.org/v5-errors-UNPREDICTABLE_GAS_LIMIT ]
Game.sol //contract using solidity
pragma solidity ^0.8.0;
contract HeadOrTail{
address public owner;
event GameStarted(address indexed player1, address indexed player2, uint256 betAmount)...
0
votes
1
answer
58
views
Pitfalls in small smart contract
Here is a question from a coding interview. I am just wondering what would be the major pitfall in this small smart contract in your opinion:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
...
0
votes
0
answers
212
views
PancakeSwap universal router usage. Web3, PancakeSwap, Bsc testnet
I'm working on an integration with PancakeSwap using Java and Web3J. All my tests were conducted on BSC Testnet.
After conducting some research, I used the UI to perform a transaction that went ...
0
votes
0
answers
97
views
Using both CoinType and Fungible Asset in Aptos Move
In Aptos, we have 2 types of tokens: Coin (e.g., APT) and Fungible Assets (USDC by Circle).
How can I efficiently receive both types in my smart contract?
Instead of a function that allows <...
-2
votes
2
answers
61
views
Why it is taking high cause fee
https://bscscan.com/address/0x1732b451aa189832109e8715b9ae0563bab7c2bc#writeContract
I have deployed this contract on BSC, can someone guide why it is taking some much gas fee.
If you have any ...
0
votes
0
answers
39
views
I am currently working on a project and encountered a persistent issue with deploying smart contracts on the Hardhat local blockchain
Issue Summary:
Problem:
When deploying two smart contracts (DonorRegistration.sol and DonationRecords.sol), they were both getting the same address on the Hardhat network, which should not happen.
...
1
vote
0
answers
38
views
How to Deploy a Smart Contract and Have Someone Else Sign the Transaction? Polygon
I'm trying to deploy a Smart Contract on the Polygon mainnet, but I need the deployment transaction to be signed by someone else's wallet (so they become the contract owner and receive the tokens).
I’...
0
votes
0
answers
96
views
Stack Underflow Error for EVM smart contract transaction
I'm having trouble making this smart contract process successfully.
Polygonscan
I have tried optimizing the bytecode and trying different parameters, but I keep getting the same errors. I can't figure ...
0
votes
0
answers
38
views
IBM Hyperledger Fabric error in packaging chaincode
During packaging of chaincode of tar.gz file in IBM Hyperledger Fabric I'm getting the below error:
Failed to determine workspace language type, supported languages are JavaScript, TypeScript, Go and ...
1
vote
0
answers
109
views
Why EIP3009 doesn't work? Looks like my signature is wrong
I am getting Fail with error 'FiatTokenV2: invalid signature'
https://sepolia.etherscan.io/tx/0x405cb5c8a6f0295d1194bf6ce794f906537cefb5b65ab2005d674812e7f66c35
The contract itself - https://sepolia....
0
votes
0
answers
58
views
Error while trying to compiler Zokrates file: square.zok
I'm trying to write and compile a ZoKrates program that verifies if a private number x satisfies x^2 == 16. The program in ZoKrates should look like this:
def main(private field x) -> field:
...
-1
votes
1
answer
254
views
Why are the NFT images not visible?
I created a ERC721 type smart contract to mint 8 NFT's to the Polygon blockchain. The NFT images are stored on my own server (for this project I don't use IPFS). I also created the corresponding json ...
0
votes
1
answer
66
views
How do I send a payment to an address other than the sender from a TON smart contract?
I'm using tact and I haven't found any resources that do this successfully: withdraw the tokens that were sent to the smart contract into a specified address.
I have attempted this code to withdraw ...
0
votes
0
answers
80
views
Facing error(Execution revert: STF) while swapping the USDC into wAVAX Tokens in Avalanche C chain
I'm facing the Error(execution revert: STF) while swapping USDC into wAVAX
I’m encountering the following error message when attempting to swap USDC for AVAX using the Uniswap V3 exactInputSingle ...
0
votes
1
answer
52
views
How can know new token(smart contract) except https://www.defined.fi/new? [closed]
I want to get name lists of new token more faster than Defined.fi/new
I am knowing just Defined.fi/new.
but more than faster, which web site or scrape tool do I have to use ?
For new token listing, I'...
-2
votes
1
answer
173
views
Where does this smart contract send the money? [closed]
I am new to Solidity and Smart Contracts.
I saw a Youtube video of a supposed automated bot which I am sure it is a scam.
This is the code the they provided and I cannot tell where the money is ...
0
votes
1
answer
89
views
function sync() in smarcontract Pair Uniswap V2 is called from where
I understand that the Pair contract will use TWPA to ensure price average, this _update function is called when Mint, Burn, Swap. In case the average period does not have the above transactions, the ...
0
votes
1
answer
94
views
Solidity Testing. 1 wei issue. How to handle rounding differences when testing balance changes in ethers.js contracts?
I'm working on a smart contract test using ethers.js, and I'm facing an issue with rounding errors when comparing ether balances of accounts after executing transactions. Specifically, the problem ...
0
votes
0
answers
42
views
FailedCall() with OpenZeppelin meta transactions (ERC2771Forwarder and ERC2771Context)
I'm encountering an issue with meta-transactions (OpenZeppelin Forwarder and Context) in my ERC-721 contract. When executing a batch token transfer via a meta-transaction, I receive the following ...
0
votes
2
answers
83
views
Ether stuck in smart contract
I have a smart contract which can hold ETH.
receive() external payable whenNotPaused {
if (msg.value == 0) revert AmountZero();
emit EthDeposit(msg.sender, msg.value);
}
function withdraw(...
0
votes
0
answers
49
views
Deploying a proxy for the smart contract using hardhat ethers is not working
I am able to compile the smart contract successfully, which generates the ABI and bytecode for the contract as expected.
Below is my deployContract function that gets the ABI and bytecode for the ...
0
votes
0
answers
94
views
Deployed smart contract on TRON not showing code tabs and transaction is missing from list
I have deployed a simple smart contract to try on the TRON Shasta network via
tronide.
Here is the simple contract address:
contract.
I assumed it would display code tabs on the smart contract ...
0
votes
1
answer
99
views
Failing to deploy smart contract through ganache gui
const ethers = require("ethers");
const fs = require("fs-extra");
async function main() {
try {
const provider = new ethers.JsonRpcProvider("http://127.0.0.1:7545")...
0
votes
0
answers
36
views
failing to deploy transction in ganache
const ethers = require("ethers");
const fs = require("fs-extra");
async function main() {
try {
const provider = new ethers.JsonRpcProvider("http://127.0.0.1:8545")...
0
votes
0
answers
73
views
FunT Ton Language send to multiple addresses
I`m writing FunC ton language. Here is my code in recv_internal:
int amount = 10004000;
slice dis_address1 = "0QCqKALVHGWllnc90l3oQ0yn6j0bJ2vyQp-IV76Dxm9TnWdL"a;
sum = sum + ...
1
vote
0
answers
82
views
Call functions from Aptos Explorer | Aptos MOVE
I wrote some unit tests for my modules, which worked well. But I don't get why I can't call these functions on Aptos Explorer
The error is showed in the image is
Error: {"message":"...
0
votes
0
answers
122
views
What is the 'executor' parameter in 1inch AggregationRouterV6 (or 'caller' in older versions)
I am using 1inch swap aggregator smart contract to swap some amount of a token to another one.
As 1inch described here in AggregationRouterV6 contract we can use the function swap as follows:
function ...