Questions tagged [contract-development]

Questions regarding the development of smart contracts

Filter by
Sorted by
Tagged with
1
vote
1answer
15 views

Can someonehelp me correct the error?

"I have tried every which way to get the flaw to go away, I tried to debug, I have _erc under-scored it, I just cannot seem to put my finger on it. here is the original contract: import "./...
1
vote
0answers
10 views

Where to outsource smart contract developers, and how to manage them as start-up's CEO?

If someone has an idea for a DApp, but needs to hire programming muscle, where online can reliable and innovative smart contract developers be found for hire and outsourcing? and what etiquette and ...
0
votes
0answers
10 views

How do i retrieve a cancelled transaction

Hi i sent ethereum from coinbase to whitebit.com. it said my transaction has been cancelled. on the other end. but should success from coin base can you help me with a solution. ...
0
votes
1answer
13 views

How to parcel out initial balances when creating a new ERC-20 token?

When I create a token, how do I specify how much of it I want to hold for myself and not offer for sale? I have seen the mint and burn functions and those would be ideal to implement as well. I don't ...
0
votes
0answers
4 views

Best way for two contracts that know each other's address?

Example situation: contract A calls a function from contract B contract B only permits only contract A to call the function (no other address allowed) I know I could do this: deploy contract B ...
0
votes
0answers
10 views

easier way to debug a NPM truffle project?

I'm using open zepplin to try to code these forks and contracts and i cant seem to get NPM to configure correctly. I have tried all of these types of things. 1. Uninstall and global reinstall NPM ...
0
votes
1answer
13 views

Update Account Balances ERC20

Are there are any design patterns or gas efficient methods of mass updating user balances (for ERC20 tokens)? For instance, say I wanted to run a casino where, after Block number X, all of the ...
0
votes
0answers
7 views

Are there any raffle smart contracts and platforms for NFTs?

Instead of smart contracts that do auctions, is there any website or DApp that facilitates smart contracts for raffles? For example, a number of participants submit an entry payment, and the smart ...
1
vote
0answers
15 views

How does PancakeSwap Lotter work? What is the Contract flow..?

I'm trying to figure out how the Lottery works... What is the flow..? How are Contracts connected? If I look at the Contract they listed ob BscScan (0x3C3f2049cc17C136a604bE23cF7E42745edf3b91) and ...
0
votes
0answers
7 views

Feedback Please For A Smart Contract Visual Programming Language [closed]

My team and I are on a mission to democratize the creation and understanding of smart contracts! In order to accomplish this mission, we have been working on a visual programming language that I was ...
0
votes
1answer
20 views

Maximum allowed amount of tokens

I would like to create a token which any wallet cannot hold more than 100 of. Is this possible while this token, also is mintable?
0
votes
0answers
50 views

ALERT: Transaction Error. Exception thrown in contract code. Metamask while interacting with contract

When I try to interact with my contract (.vue, Web3) via Metamask browser extension, I get the warning "ALERT: Transaction Error. Exception thrown in contract code." when I attempt to buy. ...
0
votes
1answer
13 views

Factory pattern for multiple contracts inheriting from same abstract contract exceeds size

I have a base abstract contract which is inherited by 3 other contracts (all having the same interface). I am trying to use a factory contract to conditionally create instances of the derived ...
0
votes
1answer
20 views

Tokens transferred to contract by mistake

I transferred some tokens to this contract 0xd0507b66A2d4C4593a54B0fa45cBAaAC2Bb04CEA and the creator of this contract is 0x102f8471d87d3Ef344af9Bd5c0845ca0A7a1d397, and I was wondering how to get my ...
0
votes
1answer
17 views

What is the Intent of smart contract and decentralization

I have just started on blockchain and found that there are two key benefits with Ethereum: smart contract and decentralization. I tried to understand the benefits they provide and why they could have ...
0
votes
1answer
19 views

Verifying/Publish Contract Source Code on BScscan not working

Verify & Publish Contract Source Code Contract Address: 0xbb4b79a046d34c68803a755a87c8b78bdde60aa8 Solidity (1 file) v0.6.12 No License I put this in. Enter the Solidity Contract Code below * ...
0
votes
0answers
12 views

How to define start block of airdrop and presale?

I've created a test contract here 0xE8229434fe87719A54776a66578e5535E3a30CdB When I try to make a function to get an airdrop, it show a big gas fee, how to set up this start block, end block, gas fee ...
1
vote
1answer
45 views

How can I demonstrate attacks on Quorum-based smart contracts in my local test network?

Currently, I am conducting a research regarding the security and privacy vulnerabilities of Quorum-based smart contracts. However, so far I've been struggling to implement attack vectors in order to ...
0
votes
1answer
12 views

How to execute a transaction within a contract given to address, and calldata?

Let's say I've got a contract called MyContract. My contract has a function which receives calldata and an address for another contract, called OtherContract I want to be able to take the calldata and ...
0
votes
0answers
14 views

Maintain two different token balances in a contract

How can we maintain the balances of two different bep-20 tokens in a single smart contract called Handler lets suppose? I am trying to write a function that transfers the second type and the first ...
1
vote
1answer
46 views

How to send uint256 and Address types to Smart contract in JavaScript web3/ethers?

Im trying to send a query to Pancakeswap's router function getAmoutsOut here the code for importing the contract using ethers ABI: const router = new ethers.Contract('...
0
votes
0answers
5 views

How are view/pure functions handled in upgradeable contracts?

I have read through some standards regarding upgradeable contracts like EIP-1538, EIP-1822 and EIP-2535, and it seems most of them rely on the proxy pattern where a proxy/storage contract with a ...
0
votes
1answer
13 views

declaration error identifier not found or not unique

pragma solidity 0.7.4; contract MyToken { address public minter; mapping (address => uint) public balances; constructor(){ minter = msg.sender; } function ...
0
votes
0answers
13 views

Distribution Fee

I want to add a distribution fee for all transactions. Example: 10 addresses with 100 tokes each. One sends 10 to another address and needs to pay 5% transaction/distribution fee. Now I want those 5% (...
0
votes
0answers
16 views

definition of base has to precede definition of derived contract

I have two different files which are Project1.sol and Project2.sol Project2.sol is like: import "./Project1.sol"; contract Project2{ address newProject1Address =address(new ...
0
votes
1answer
16 views

How to allow each voter to vote only once? [Very Simple Voting Contract]

first, I apologize for this very very very simple question. I'm starting my studies on smart contracts, and after many attempts, I have not been able to solve this problem. Objectively, this is a ...
0
votes
2answers
16 views

i am very confused on what's wrong on line 16. balances[msg.sender] = totalSupply;

pragma solidity ^0.8.2; contract Token { mapping(address => uint)public balances; mapping(address => mapping(address => uint))public allowance; int public totalSupply = 10000 * ...
0
votes
0answers
17 views

Calling the fuction GetEthToTokenInputPrice

Please help since I'm getting furious over this problem. I deployed a contract to the ropsten network, and am trying to call a function getEthToTokenInputPrice to see if it worked through solidity. I ...
0
votes
1answer
20 views

Why the sender is not approved? (v0.8)

I have the following code: import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; contract Collectioning is ERC721 { ... address ownerAddress = ownerOf(_tokenId); address payable pSender ...
0
votes
1answer
13 views

Identifier already declared

event transfer(address indexed from, address indexed to, uint value); event Approval (address indexed owner, address indexed spender, uint value); constructor(){ balances[msg....
0
votes
0answers
14 views

How to pass a blank bytes calldata into a solidity function call?

I have a function that looks like this: function foo(uint _someVar, bytes calldata _data) public { ... } Then I make a call to it from another function with "" as _data: foo(123, "&...
0
votes
0answers
8 views

How do you test your contracts, and how long do you spend testing?

I want to improve how I test to increase my effectiveness and efficiency, so would like to hear from others. How do you test your smart contracts i.e. do you have a particular methodology for what ...
0
votes
1answer
4k views

Cannot estimate gas error on Uniswap / Sushiswap

I'm trying to swap at Ropsten network some tokens for testing purposes, but I'm getting the following error: Cannot estimate gas. It's curious because when I transfer from one wallet to another ...
0
votes
0answers
20 views

Parse error, newbie here, what's going on? [closed]

Remix tells me the following code below has a parse error, but no matter how hard I look, not parenthesis or comma is missing! contracts/test.sol:88:62: ParserError: Expected ',' but got identifier ...
1
vote
1answer
17 views

Do not allow to register twice

Let's suppose I have this struct: struct Agent { uint idAgent; address direction; uint[] preferences; } Agent[] agents; And there's a function: /// @notice Registra a un nuevo agente a la ...
0
votes
0answers
18 views

How many smart contracts one should have?

Suppose there are 4 entities, A, B, C and D. A provides its identifier to B and seeks its decision. B needs to call C providing it with the identifier of A and some other parameters so that it can ...
0
votes
0answers
8 views

DeclarationError: Identifier not found or not unique. Two contracts in the same file

This is the Contract that I want to use a function of: contract Origin{ uint transfer_amount = 0.1 ether; address payable owner = xxx; function invest() external payable { owner....
0
votes
1answer
22 views

What is Solidity revert code “-32000” when interacting with contracts via Remix IDE?

I wonder if the error "VM Exception while processing transaction: revert", "code": -32000" thrown by the Remix IDE indicates the 0x32 Solidity panic exception happening when ...
0
votes
0answers
6 views

In the context of Ethereum contract creation, what does “cyclic creation dependencies are impossible” mean?

I'm reading the official solidity docs and came upon this passage on Ethereum contract creation: "cyclic creation dependencies are impossible", followed by the example code below (and also ...
0
votes
0answers
14 views

passing left for uint256

I'm trying to use this method: function test(uint amount) public { address(0xf5eA38B6b9644224dA1aECbC1219e8543c0689b2).call(abi.encodeWithSignature("deposit(uint)",amount)); } ...
0
votes
0answers
35 views

How can I set the price of my cake token into bnb in pancakeswap

Where can we set the price of the cake tokens so that we can easily convert bnb to cake tokens and vice versa in the pancakeswap contracts? Any help?
0
votes
1answer
15 views

Getting contract address

I saw an example about this, while was searching it on the internet. I want to deploy a new contract which is ProjectContract. However, I could not get contract address as below. I think this is for ...
0
votes
1answer
24 views

Trying to burn 1% off each transcation

Can anybody show me how to add a code for burning %1 of each transaction? https://github.com/strainzeh/MADToken/blob/main/MADToken.sol
0
votes
1answer
90 views

Trouble using Remix to deploy to BSC TestNet

Hey yall im getting this error when trying to deploy to smartchain testnet Gas estimation failed Close Gas estimation errored with the following message (see below). The transaction execution will ...
0
votes
1answer
55 views

I added a charity address to my contract and now I have two, can I remove one?

The token in question is listed at the following url: https://bscscan.com/address/0x3656b9d510af37b22cc1a5c904eb90855f953fbe I had a charity address and fee address displaying ...
1
vote
0answers
75 views

Interfacing with Uniswap/Pancakeswap locally

I'm interacting with PancakeSwap for the first time, as I'm developing a token that interfaces with PancakeSwap. Ideally I'd like to iteratively test it without deploying to a live network. Must I ...
0
votes
0answers
17 views

how to create automatic asynchronous transactions form smart contract

i created a stackable erc20 token with the capability for the contract owner to distribute rewards for stakes manually (via this tutorial). Is there a way to make the rewards go out automatically from ...
0
votes
0answers
78 views

Can I burn tokens held by uniswap/pancake contract?

I'm trying to implement a function in solidity that burns tokens in liquidity. e.g I add 10k tokens to pancakeswap, after some sales I have 15k tokens in liquidity and I want to burn 5K, so I decided ...
0
votes
0answers
16 views

How storing private key in blockchain is secure (FADB paper by Hui Li)?

I am a newbie in blockchain and smart contract. I was reading the following paper. FADB: A fine-grained access control scheme for VANET data based on blockchain https://ieeexplore.ieee.org/stamp/stamp....
0
votes
0answers
13 views

Selling NFT's, buyer calls minting function, how to call transfer function?

I'm implementing a dApp to sell NFT's. I want the buyer to call the function on my smart contract to mint the NFT so that they pay for the gas fees. However it seems like they can't then transfer that ...

1
2 3 4 5
74