Linked Questions
13 questions linked to/from How does a contract find out if another address is a contract?
1
vote
2
answers
3k
views
Is there any simple function done in Solidity to check if an address is a contract address or a wallet address? [duplicate]
I'm looking for a function that will tell me if an address is a contract address or an externally owned address / wallet address.
I tried with this function, however this only tells me if the address ...
0
votes
3
answers
432
views
Revert if caller of contract is another contract [duplicate]
I'm trying to limit the access of functions in my contract to only normal user addresses, to prevent the 'revert-and-retry attack' described here.
Quick excerpt from that link:
victim.tryMyLuck();
...
0
votes
1
answer
239
views
Reliable way to identify the caller [duplicate]
Is a reliable way to identify the caller with the following code?
bool isContract = msg.sender != tx.origin;
109
votes
2
answers
42k
views
What's the difference between 'msg.sender' and 'tx.origin'?
If either are used in the body of a Solidity function that may change the state of a contract (write call), what's the primary difference and/or benefit of using one over the other. For example:
...
42
votes
5
answers
28k
views
How to detect if an address is a contract?
I'm interested in knowing whether any particular address is a contract address or a standard address. There have been similar questions on the topic, but I'm not looking to detect whether an address ...
20
votes
2
answers
8k
views
isContract function using EVM assembly to get the address' code size
My problem is that I need to make sure my contract processes only the transactions coming from EOA (externally owned accounts). For this I need to determine the type of account I'm dealing with. In ...
5
votes
1
answer
634
views
tx.origin alternative
I couldn't find an appropriate, simple fix of the tx.origin vulnerability, without having to use any modifier, any help is very much appreciated,
thanks,
PS: msg.sender is not what I'm looking for (...
1
vote
1
answer
730
views
How do you know if a contract is destroyed?
I'm using web3.py to interact with contracts. I was wondering, after calling a function with selfdestruct or suicide(address), how do I find out that the contract is in fact dead?
0
votes
1
answer
482
views
How to check if there is no smart-contract deployed on selected address? [duplicate]
For example if I want to warn my user that he make mistake in contract address.
1
vote
2
answers
788
views
Prevent Transfer of ERC20 token to contract address?
I want my ERC20 contract to be transferred to EOA addresses only and some specific contract address only.
I don't want to lose my tokens by mistakenly transferring to a contract address that cannot ...
2
votes
1
answer
361
views
Modifier for no-contract calls [duplicate]
The modifier used to check if a contract calls a function in Solidity used the assembly code extsize. I wonder why this is done. Using assembly seems very "hackish" to me (why does solidity not have a ...
0
votes
1
answer
191
views
Can I detect from tx metadata if a transaction made with a Metamask account were executed by a script?
I have a Metamask account what I use with web3.js/web3.py/or any web3 lib to buy and sell tokens. Is it possible to tell if the transaction was done from the Metamask Chrome plugin interface or was ...
0
votes
0
answers
16
views
Detecting difference between EOA and a contract with regard to smart wallets
I'm using the assembly code given at the URL below to check if an address is an EOA or a contract:
How does a contract find out if another address is a contract?
However, I'm not sure how this will ...