Skip to main content

Questions tagged [contract-design]

for high-level questions about the choices made during contract construction

Filter by
Sorted by
Tagged with
0 votes
0 answers
20 views

4 Most Important Questions For Smart Contracts Developers

Hello Smart Contracts Developers Which Blockchain like Etherscan, Bscscan, Polygonscan, Tronscan.... etc that automatically approve new token logo and token value application? Which stable coin ...
Tether Usdt's user avatar
0 votes
0 answers
15 views

Where to find callee smart contract address?

I am working on smart contract analysis and focusing on smart contract interaction. My goal is to avoid executing the contracts and I wanted to know if it is possible to get the address of a called ...
Charles Lohest's user avatar
0 votes
0 answers
28 views

I accidentally sent ONDO tokens to its Contract Address

I mistakenly sent my ERC-20 token (ONDO) to ONDO Contract address. Transaction hash is 0xed0ade205a2380adaabb9d2185abcd0313f220b8b381a189bc5d62ba83d3fbf4. Please, I accidentally sent ONDO tokens to ...
Okwudili's user avatar
1 vote
0 answers
19 views

How to encode/decode complex conditions into 256 bit

I'd like to encode conditions in a single 256 bit integer to avoid storage costs. For example, assume that user passes 4 addresses(address[] type) to my smart contract function and he also wants to ...
irma magradze's user avatar
0 votes
0 answers
19 views

bought a token that is unsellable, but I can see that on Etherscan that few accounts are selling the same. Is there a way I can sell this token [duplicate]

I bought this token 'Monad' on uniswap. It seems to be all fine but than later realized that this token is unsellable. I can see that the team are able to sell the token, and so did someone else who I ...
Rajiv Chandla's user avatar
0 votes
0 answers
16 views

Most decentralized and secure ways of listening to events for multiple wallets

The most common for listening to events emitted by multiple smart contracts seems to be by using a JSON-RPC wrapper such as ethers or web3js. Let the contracts be ERC-721. If our contract emits an ...
root's user avatar
  • 11
1 vote
0 answers
14 views

Does `call` opcode panic if less size data is returned?

I was reading the zksync documentation and found the following in the differences section here For calls, you specify a memory slice to write the return data to, e.g. out and outsize arguments for ...
Neo's user avatar
  • 103
0 votes
0 answers
20 views

unable to sell token despite seeing other wallets selling

I bought this token on base network and the contract looks perfect to me, but i realize i was unable to sell/swap the token after increasing the slippage to 50%, i can see other wallets selling and i ...
Job Toni's user avatar
0 votes
1 answer
42 views

Is it possible to create a transaction as an admin and send it but with someone else paying for the gas fees?

I have a mintToken method in my smart contract that is onlyAdmin. The problem I have is that I don't want to pay for the transactions for my users every time I execute this function (and it also can't ...
Falcon Stakepool's user avatar
1 vote
0 answers
35 views

Does this token contract look right?

I am not a coder or even thought about code until my run in with one of these guys (smart contract) and ill be honest its been rather interesting trying to work this out and learning a lot i think ...
DaV08900's user avatar
0 votes
1 answer
30 views

Sent Eth to contract address can I get it back

I sent some Eth to a contract address rather than my wallet. Can someone with some code experience have a look at this contract and let me know if there is a function on here that the Devs could use ...
Fez's user avatar
  • 3
1 vote
1 answer
70 views

getting address field from assembly

Assume the following solidity code: function caller(uint k, uint v) public { (bool success, ) = address(this).call(abi.encodeWithSignature("callee()", abi.encode(k, v, msg.sender))); ...
Giorgi Lagidze's user avatar
0 votes
1 answer
62 views

Transaction Hijacking?

So I created a wallet and sent it some funds then I submitted a few invalid transactions. I approved the correct address for transferring wrapped eth. After the approval my script immediately sent the ...
Samuel Wagner's user avatar
3 votes
2 answers
243 views

What's type hash's usecase in EIP-712?

Assume I'm implementing EIP-712 signatures in solidity. contract Nice { bytes32 private constant BID_TYPE_HASH = keccak256("Bid(uint256 num1,uint256 num2)"); struct Bid { uint256 ...
Neo's user avatar
  • 103
1 vote
0 answers
20 views

How can I design smart contracts for p2p vehicle trading?

The idea is to have two contracts: OrderManager Contract NFTMinting Contract OrderManager will manage the funds transfer for the vehicle; buyer will deposit the funds, the seller will withdraw them; ...
Geek's user avatar
  • 31
1 vote
2 answers
92 views

msg.sender vs owner

Is it bad practice (or risk prone) to use owner instead of msg.sender when checking actions initiated by a caller? ...even if I check that owner is authorized by msg.sender to do the mentioned actions?...
dNyrM's user avatar
  • 938
0 votes
1 answer
42 views

Will upgrading a smart contract to inherit from a new base class cause potential storage conflicts with UUPS proxy pattern?

I have an ERC20 contract like so: contract myToken is ERC20BurnableUpgradeable, OwnableUpgradeable, UUPSUpgradeable, PausableUpgradeable { mapping(address => uint256) public totalSpent; ...
Barney Chambers's user avatar
0 votes
0 answers
14 views

there is a bot code on you tube [duplicate]

there is a bot code on you tube, where can i go to check if its a scam> here is the code. code: https://codepastes.com/raw/wJLpHt you tube: https://youtu.be/a2oGKFSWhuk?si=gJiqVdatk17qXi2f
Francisco Alvarado's user avatar
0 votes
0 answers
41 views

My contract level metadata is not showing on Opensea!

I need some help I'm new to solidity and I'm reading the docs for opensea, but I must be missing something. I have an ERC721 contract on Polygon, but the contract level metadata won't show. I'm ...
Ordo's user avatar
  • 1
0 votes
1 answer
22 views

re-revert error data with non-external function

my question is how what if one of swaps in doSwapChain revert how i can re-revert that error(UniswapV2 error) with my error that have the index number of the swap and also the error that reverted(...
CorrM's user avatar
  • 15
1 vote
3 answers
89 views

Transanction rejected by EVM when i tried to call a claim function from an airdrop contract

This my contract /** contract JayTechAirdrop { address public owner; address public jayTechTokenAddress; uint256 public claimAmount = 1e6 * 1e18; // 1 million JayTech tokens uint256 public gasFee; ...
Hallenjay's user avatar
0 votes
0 answers
36 views

Efficient Storage Strategies for ERC721 with Editable Content

I'm just starting to learn about smart contracts, Ethereum and NFTs. It's all new and I need your help with managing editable NFTs. I want to create a NFT with content that is easy to modify while ...
user9541033's user avatar
0 votes
1 answer
32 views

GoFundMe Contract: Minting "Thanks" over time vs all at once & "Thanks" token value

I was assigned to write a smart contract for class (to be deployed on a test-net), which, upon receiving ETH, returns to the sender some amount of tokens with symbol "Thanks". I want this ...
Alex Byard's user avatar
0 votes
1 answer
140 views

Bought a scam token, trying to understand what part of the code should I check next time to prevent that

Contract code - https://etherscan.io/token/0x67bcd18a484a88f073097a18b0462eb7c44d3178#code Ownership renounce at 08:17 UTC https://etherscan.io/tx/...
Dan's user avatar
  • 1
0 votes
0 answers
13 views

How can I mimic legacy bank in my project?

I want to build a project where legacy bank interacts with blockchain networks (over CCIP). Please suggest me how can I mimic a legacy bank - as a separate project or any different idea is appreciated....
Inderdeep01's user avatar
0 votes
1 answer
35 views

How do I add my address to a deployed contract public address using a security exploit? (coding challenge)

I'm working on a coding challenge for smart contract security exploits. I need to add my address to public address (browerr) in the contract. Do I need to create another contract that inherits the ...
johnTg's user avatar
  • 1
3 votes
2 answers
116 views

Are storage variables tightly packed like struct fields?

Tight variable packing is a known coding pattern in Solidity for saving gas by placing struct fields that are lower than 256 bits closer to one another. Does this logic apply to storage variables? ...
Paul Razvan Berg's user avatar
0 votes
1 answer
39 views

How do you use the Diamond Pattern for escrow upgrades?

I am creating a contract with the diamond pattern so I can evolve and add new features to my contract. Contract facets: Contract A: an ERC721 that takes care of minting its own NFTs Contract B: ...
Piyush Chittara's user avatar
0 votes
1 answer
20 views

Can you refer to a contract inside itself?

Sorry this is a very minor question but the following is part of a contract called LibOrders.sol. The function below calls LibOrders.cancelOrder....normally I think you would just put "...
auditor_chick's user avatar
1 vote
1 answer
100 views

Why do some developers make their base contract inherit its Interface?

Some protocols and developers inherit the contract's Interface inside of the base contract and then have the interface contain the actual NatSpec, is this simply for human readability/code ...
Rohan Nero's user avatar
  • 1,617
0 votes
1 answer
363 views

How much does it cost to clog the Ethereum Network exactly?

Currently the largest gas guzzler to clog the Ethereum network is the Mint contract below. Supposedly there are users purposely causing high gas prices using this function. Why would anyone do this ...
Patoshi パトシ's user avatar
0 votes
0 answers
29 views

Function Visibility specifiers during inheritance

when am overriding a function in solidity must my child function have the same visibility as the parent function? can the parent function be public and the child function be internal
Emmanuel Anah's user avatar
1 vote
2 answers
99 views

Malicious smart contract that transfers tokens forth and back

Sorry if my question was already discussed. Is it possible to implement such a smart contract or contracts that in result can transfer eth or ERC20 tokens forth from ANY to B account and back from B ...
Oleg's user avatar
  • 11
0 votes
1 answer
34 views

Can an individual NFT that's not been minted yet have a whitelist?

As it's not been minted yet, it doesn't exist, right? However, what if I had an idea to create a future collection of 333 NFT. And I wanted to allow certain users to mint certain NFTs. Meaning, future ...
DankenN's user avatar
  • 31
0 votes
1 answer
694 views

Not able to sell token, where is the tricky code in it

I bought a small amount of this token, but later on doing some more research I found old projects from the creator scamming people: 0x746a2890c506E11597D0b5d805f7d4d6E980667D im not able to sell that ...
Marcel Dz's user avatar
  • 103
0 votes
1 answer
535 views

How to find owner of contract deployer on etherscan website

https://etherscan.io/address/0x6cfa7561bbf940ab4b5c0507d4c9e45c68552b1b On the Etherscan website, where or how do i navigate to the deployer wallet of this contract? Apparently if i look closely at ...
Jim41Mavs's user avatar
  • 103
2 votes
1 answer
174 views

Do immutable variables influence the contract bytecode?

Suppose you have a contract like this: pragma solidity >=0.8.19; contract Bar { uint256 public immutable value; constructor(uint256 value_) { value = value_; } } Will Bar ...
Paul Razvan Berg's user avatar
0 votes
1 answer
19 views

How to call a read function within "contract B1" when the function is defined in a higher contract that imports "contract B1" as an extension?

I want to use the totalSupply function within an extension contract, but the function is not declared within the contract and is added in from a different contract extension. Both extensions are ...
Nunber1's user avatar
1 vote
1 answer
3k views

bought a token that is unsellable, but I do not spot the code in the contrat that is responsible

I bought this token, had a good app for trading and a well written medium which didn't seem scammish at all. the token even managed to pass on the normal basic tools for honeypot detection and ...
user119739's user avatar
2 votes
1 answer
65 views

Is there any way to selectively include logic in a contract during its construction?

We have a contract that adheres to the ERC-3156 standard, which provides flash loan functionality. We intend to deploy this contract multiple times, and in certain cases, flash loan capabilities are ...
Paul Razvan Berg's user avatar
2 votes
2 answers
514 views

restrict the NFTs of my contract (ERC721) to be traded on marketplaces?

Are there tricks in solidity to prevent the NFTs minted by an ERC721 contract to be (a) not recognizable and (b) not being transferable by marketplaces like OpenSea, SuperRare. I see those possible ...
Majd TL's user avatar
  • 3,247
2 votes
2 answers
383 views

Why's it all being displayed as Big Number if I am using ethers.utils.parseEther? Is this normally how it displays in console?

In my hardhat test file I am converting ERC20 tokens transactions/balances with ethers.utils.parseEther like... const ONE_ETHER = ethers.utils.parseEther("1"); So if everything is being ...
Blockpain's user avatar
  • 173
1 vote
1 answer
242 views

Troubling shooting hardhat test failure - ERC20 approve & transferFrom issues

One of my hardhat tests is failing and I am hoping someone assist with. I have 2 smart contracts posted here and the test file I am running. My question is at the bottom. It's a bit lengthy to look ...
Blockpain's user avatar
  • 173
1 vote
1 answer
30 views

Is this problem a front-running or race-condition or something else?

What is the correct name of this problem in audit terms? If I have a contract that sells NFTs. The address with the most NTFs has a very high chance to win a prize. The problem is that 1 address can ...
Majd TL's user avatar
  • 3,247
0 votes
1 answer
54 views

ERC1155 and ERC1155UriStorage Question

For anyone who has worked with Open Zepp's ERC1155 and ERC155UriStorage. Both of them have a _setURI function and a uri function (returns the token uri). 2 questions when using both of these ...
Blockpain's user avatar
  • 173
1 vote
0 answers
44 views

Creating two separate funds in a single smart contract

I am attempting to create a smart contract with two separate funds/ vaults. So far, I have approached it by creating two separate payable functions, arrays, and mappings with separate permissions for ...
Ryan Glenn's user avatar
1 vote
1 answer
20 views

My payout function to lottery winners is failing. I'm storing the winners in an array and attempting to payout but getting reverts

the code: function payoutWinners() public payable { require(msg.value >= payoutOwed, "send more than what is owed"); for (uint i = 0; i < winningAddresses.length; ...
snejad123's user avatar
2 votes
2 answers
189 views

Why does a contract store how much eth it's been sent, internally?

Beginner question: In one or two smart contracts samples, I've seen that a function is payable but the smart contract seems to hold its own state on the total it has received, e.g. total += msg.value. ...
Luke Puplett's user avatar
1 vote
0 answers
10 views

Instantiate contract from clone factory with value [duplicate]

I'm currently trying to create instances of a smart contract via a clone factory. The problem is, that I'm not able to send a value to the init function of the smart contract I'm trying to instantiate....
unsigned_int2's user avatar
0 votes
1 answer
43 views

how to fix the phrase error: Expected ','but got ;

// SPDX-License-Identifier:MIT pragma solidity ^0.8.0; import "@openzeppelin/[email protected]/token/ERC20/ERC20.sol"; // The contract's name is "CryptoInsurancePolicy" contract ...
Brendan Shawn's user avatar

1
2 3 4 5
42