Questions tagged [code]
The code tag has no usage guidance.
43
questions
0
votes
0
answers
19
views
I think I am been scammed and need help [duplicate]
I invested some money through the website haloporeth.xyz. After completing a 60-day staking period, they sent me instructions to unstake my earnings. However, they are asking for additional funds, and ...
0
votes
1
answer
52
views
Uniswap Bot with AI Contract. Is it a scam or not?
Today I found sponsorized YouTube video to make 1ETH a day with a bot in Remix.
Is it legit the code?
what you think about it?
https://www.youtube.com/watch?v=oB_kJRjkyio
I have no experience in ...
0
votes
1
answer
29
views
why is my loop not working in below solidity code
What's happening here in the code and why is my loop not working? And one more thing, should I remove all the warnings from my code before deploying?
function sub(uint n, uint a) external pure returns(...
0
votes
0
answers
15
views
Hello,I wish to know if this defi flashloan code is correct and I can compile with remix [duplicate]
pragma solidity ^0.6.6;
// Uniswap Deployer
import "https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/interfaces/IUniswapV2Callee.sol";
// Uniswap Manager
import "https:...
0
votes
1
answer
33
views
How to send a message from one contract to another using an interface in Solidity?
Context:
I am developing a smart contract system using Solidity that involves two contracts:
HashedTimeLockEther (Main contract)
Messenger (Interface contract)
Objective:
I want the ...
0
votes
1
answer
83
views
verify if a token is not a honeypot
automatically, via code, what is the best way to verify if a token is a honeypot or not.
I tried:
contract verified or not
some external APIs (not very reliable)
lint the contract
1
vote
0
answers
20
views
Need to perform self destruct contract
I have been involved in a scam and need to get my funds transfered to another wallet in my name. I assume there is a contract preventing send capability, so I need someone who knows how to perform a ...
0
votes
0
answers
12
views
have you seen false calims of code using ChatGPT in Arbitrage strategy and slippage? [duplicate]
I have seen identical videos on you tube and in other sites claiming to make passive income through code from ChatGPT in Arbitrage strategy and slippage.
ALL FAKE and will take your ETHER. If this ...
0
votes
0
answers
14
views
Problema con stablecoin Blockchain
Buongiorno ho scritto il codice del mio stablecoin ma ho bisogno che sia visionato da un esperto per correggerlo eventualmente e creare le proxy e magari cominciare la programmazione della propria ...
4
votes
1
answer
197
views
How can I use BLS12-381 curve operations:EIP-2537, Whether it's on a public or private chain
Recently I have been doing an experiment to sign smart contracts with bls12-381, but I can't find any tutorial or code for this, Is there any way to do that? please tell me if you know about it.
0
votes
0
answers
53
views
Withdrawal safety from scam? [duplicate]
Thank you for taking your time to explain & help
Basically i'v run a bot (from scam...) on scammed remix environnement..
I'v several error when trying to withdrawal, one of them was that there was ...
0
votes
0
answers
19
views
Token Approval Removal
Someone has gotten multiple Token Approvals on my account, likely through my own fault, but I cannot tell when.
they have token approvals on MATIC and ETH. so that when I transfer ETH into remove the ...
0
votes
1
answer
10
views
Does this line of code make sense?
I'm looking at the following code, specifically this line "if (nOffboardingsInProgress++ == 0)", and I'm wondering about the way that line is written. Don't you need to first increment ...
0
votes
0
answers
11
views
Would this work to add a check that a signature hasn't already been used?
I'm working on an exercise to learn smart contract security, and I am trying to add a check that a signature has not been previously used to this withdraw function. Below I put the original function ...
0
votes
1
answer
38
views
Creating a local variable in an if statement?
I'm looking at a function that creates a local variable in an if statement. If someone called that function and the condition to the if statement was not triggered, that local variable wouldn't exist, ...
0
votes
2
answers
20
views
Explain this constructor inheritance solidity
Is BranchBridgeAgentFactory the parent contract?
Will there be two different address? Or just one?
pragma solidity ^0.8.0;
contract TestBranchBridgeAgentFactory is BranchBridgeAgentFactory {
/*////...
2
votes
1
answer
87
views
Where in the code of this unstake function is ETH actually transferred?
I am looking at this repo, which is contracts for a decentralized pegged asset issuance system backed by liquid staking tokens like rETH. Specifically, I have a question about the functions unstake in ...
0
votes
0
answers
20
views
Treating two assets as equal in a smart contract that aren't equal
I am auditing a protocol that creates a token yETH representing a basket of liquid staking tokens such as rETH and stETH. I noticed that the protocol treats yETH as if it is 1:1 with ETH when it's ...
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 "...
0
votes
0
answers
24
views
What happens if you divide a uint256 by a uint88 using divU64?
I am looking at the following function. It takes a uint256 (ercDebtSocialized) and uses safemath divU64 to divide it by a uint88. I assume this would just throw an error? I unfortunately cannot test ...
1
vote
1
answer
67
views
Two people calling this function at exactly the same time
I was looking at Rocket Pool's docs on interacting with other contracts and they included a simple example function that another protocol could use to accept deposits of ETH, forward it to RP, and get ...
0
votes
2
answers
92
views
Can a function call itself?
Can a function call itself...specifically, I am looking at this code and I can't figure out how this could work properly...the parameter vault would be the first parameter in the line that calls ...
1
vote
1
answer
21
views
Can you return something only some of the time with a function in solidity?
I am looking at a function that says it returns two uints, but the return statement is inside an else statement, so obviously there are conditions under which nothing would be returned. Can you have ...
0
votes
1
answer
61
views
Revert inside a for loop
If there is a revert inside a for loop that is inside a function, and the revert is triggered, will the whole function revert?
0
votes
1
answer
60
views
Can I modify a smart contract's code? [duplicate]
I get scammed big time, not proud! The worst? I can see the ETH on a watched only account. I think there's not really withdraw function at all in the code. Can I modify it to withdraw the funds and ...
0
votes
1
answer
25
views
Expected identifier but got ';' ? I am writing a poker game in Solidity and having problems declaring sortedCards as a state variable. Help:)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract NoLimitPoker {
address public dealer;
address public smallBlind;
address public bigBlind;
uint public minBuyIn;
...
0
votes
1
answer
19
views
Doubts on computing ETH daily number of active addresses
I am trying to compute the number of daily active addresses from the ETH's blockchain. For this, I am using this mild SQL query:
SELECT
date_trunc('day', block_timestamp) as day,
COUNT(...
1
vote
2
answers
641
views
Does the EVM revert if a call is attempted to an address that doesn't have code?
The following code would revert in high-level Solidity if the provided addr is an EOA or a contract that does not implement MyInterface:
interface MyInterface {
function myFunction() external;
}
...
1
vote
2
answers
520
views
How to concatenate 2 strings in Solidity?
Question in the title, how to concatenate 2 strings in Solidity?
Googled and searched here but no luck.
Please help,
Thanks
1
vote
1
answer
419
views
How do I manipulate the elements of a memory array in assembly?
Simple example:
Let's say I have a function that takes a fixed size array, finds the largest number in it, and returns another fixed size array in memory with the largest number as the last index:
...
1
vote
0
answers
43
views
Why two different source code generate same control flow graph in ethereum smart contract?
I analyzed control flow graph of two contracts written in solidity with different source code, one having vulnerability and other after resolving it. https://swcregistry.io/docs/SWC-107#modifier-...
0
votes
1
answer
30
views
Explain the idea of an array of contracts in solidity and the implementation of "sfStore" function in the code attached below
SimpleStorage[] public simpleStorageArray;
function createSimpleStorageContract() public {
SimpleStorage simpleStorage = new SimpleStorage();
simpleStorageArray.push(simpleStorage);
}
...
0
votes
1
answer
54
views
Feasibility for Vulnerability Detection in Smart Contracts
I am excited to find out which is more feasible for vulnerability detection in ethereum smart contracts(solidity): Source Code or ByteCode and what's the reason?
0
votes
1
answer
48
views
Ethernaut Challenge Shop
I don't understand why remix doesn't allow me to compile this code, even though the logic is similar to the answers I found on the internet.
The error: from solidity:
MyContract.sol:20:11: TypeError: ...
0
votes
1
answer
18
views
solidity doubt error unknown [closed]
ParserError: Expected pragma, import directive or contract/interface/library/struct/enum/constant/function definition.
--> contracts/college.sol:104:1:
|
104 | }
| ^
1
vote
1
answer
19
views
Where can I find how the Ethereum protocol calculates transaction fees, supply issuance, and other key components?
I would like to learn how different components of the Ethereum protocol are calculated. Where can see how these and other elements?
Is there a code database that a final code source that I can refer ...
1
vote
0
answers
40
views
how import in remix smart contract without source code?
I am trying to call a fallback function on a smart contract that has not verified contract source code, How can I do this?
Thanks in advance
0
votes
1
answer
528
views
Can I put html code as an onChain NFT?
Can I put html code as an on-chain NFT?
I don't want the NFT to be an image, I would like it to hold html code.
e.g the NFT will be Hello world
3
votes
2
answers
5k
views
how to Get All tokens against a specific Walllet Addresse?
Is It Possible to get All tokens against a specific wallet Address , whether it is deployed on a ethereum blockchain , solna , polygone or whatever ?
1
vote
1
answer
512
views
Does address.code return runtime or creation code
You have three options to retrieve bytecode: type(C).runtimeCode which returns the runtime code of a contract, type(C).creationCode which returns the creation code of a contract and address.code which ...
0
votes
1
answer
17
views
Gnosis safe not letting transfer of tokesn
I have an issue with a safe that is a mutli sig and i have a token contract on there that it will not let me send any of the tokens it lets me and my others confirm it but on the execute function it ...
1
vote
0
answers
1k
views
TypeError: Operator * not compatible with types int256 and uint256 --> contracts
Fairly new at this so there's probably an obvious answer. I was just playing around with an interest bearing contract. this below works out fine:
uint interestPerSecond = _interest * (_amount / 1e16); ...
0
votes
1
answer
136
views
Store addresses in bytes variable
I need help with storing a bytes value.
contract StoreBytes {
bytes public addresses;
function addMe() external {
// TODO Add msg.sender to addresses.
}
}
What I want is that msg....