Skip to content

Tx.origin refers to the original account that started a transaction. msg.sender refers to the account that called the function. For security reasons, it's better to use msg.sender.

Notifications You must be signed in to change notification settings

wisdomn200/Tx-origin-Attack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tx origin Project

Tx.origin refers to the original account that started a transaction. msg.sender refers to the account that called the function. For security reasons, it's better to use msg.sender. This project demonstrates an attack which shows why you shouldn't use tx.origin. it contains a basic Hardhat use case, a sample contract, a test for that contract, and a script that deploys that contract.

Try running some of the following tasks:

npx hardhat help
npx hardhat test
REPORT_GAS=true npx hardhat test
npx hardhat node
npx hardhat run scripts/deploy.js

Tx-origin-Attack

About

Tx.origin refers to the original account that started a transaction. msg.sender refers to the account that called the function. For security reasons, it's better to use msg.sender.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published