Skip to content

AzureKn1ght/extcodesize

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

extcodesize

Q: Create 3 smart contracts with the below functions

Level: Medium 

  • First smart contract

Create a function to check if the “msg.sender” is a contract address or a non-smart contract address by using “extcodesize” function. This is to protect the smart contract from being interacted by other smart contract.

  • Second smart contract

Create a smart contract to interact with the first contract but it will fail due to the check function of the first contract.

  • Third smart contract

Create a smart contract to interact with first smart contract and successfully passes the check function of the first contract.

Deploy all the smart contracts to the Ethereum Testnet (Ropsten/Rinkeby)

Verify the source code in Etherscan.

Deployed Example

An example has been deployed and Verified on the Ethereum Testnet (Ropsten).

  1. First smart contract: 0xB09464f86D042d6caEf0D42B9965c1136855Af6C
  2. Second smart contract: 0x0C4137CB28aAd5d694AB9469b6956807Dfec442c
  3. Third smart contract: 0x321ab8D72bf692FD073D727379068139c2ae19b9

About

Sample codes to test the “extcodesize” function in solidity smart contracts.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors