In this example, the _asset can be an ERC20 (!= address(0)) or ETH (== address(0)).
When transferring ERC20 tokens, it's crucial to ensure that the user doesn't send msg.value during that transaction. Otherwise, the value they send will be lost.
t's also important to check if the msg.value is equal to the amount when the asset is actually ETH (== address(0)). @EthSecurity1
When transferring ERC20 tokens, it's crucial to ensure that the user doesn't send msg.value during that transaction. Otherwise, the value they send will be lost.
t's also important to check if the msg.value is equal to the amount when the asset is actually ETH (== address(0)). @EthSecurity1
One of my favourite Foundry features is running tests in watch mode.
It allows me to iterate really fast by changing the solidity files while my tests are being re-run.
e.g. $ forge test --match-test test_NameOfYourTest --watch
More on the command: https://book.getfoundry.sh/forge/tests?highlight=watch#watch-mode @EthSecurity1
It allows me to iterate really fast by changing the solidity files while my tests are being re-run.
e.g. $ forge test --match-test test_NameOfYourTest --watch
More on the command: https://book.getfoundry.sh/forge/tests?highlight=watch#watch-mode @EthSecurity1
👍4❤2🔥2
https://medium.com/coinmonks/analysis-of-the-billion-dollar-algorithm-sushiswaps-masterchef-smart-contract-81bb4e479eb6
@EthSecurity1
@EthSecurity1
Medium
Analysis of the billion-dollar algorithm — SushiSwap’s MasterChef smart contract
In this post, I would like to scrutinize one of the SushiSwap’s core smart contract. Especially, I would like to show a mechanism of the…
🔥5
https://ethscriptions.com
It's cheaper and more decentralized than using contract storage.
Also protocol guarantees global uniqueness of the content of all valid Ethscriptions!
Plus it's skating to where the puck is going in an L2 world. https://ethereumpunks.net
@EthSecurity1
It's cheaper and more decentralized than using contract storage.
Also protocol guarantees global uniqueness of the content of all valid Ethscriptions!
Plus it's skating to where the puck is going in an L2 world. https://ethereumpunks.net
@EthSecurity1
🔥3
EthSecurity
https://ethscriptions.com It's cheaper and more decentralized than using contract storage. Also protocol guarantees global uniqueness of the content of all valid Ethscriptions! Plus it's skating to where the puck is going in an L2 world. https://ethereumpunks.net…
ESIP-1: Smart Contract Support
Specification
Incorporate two new smart contract events into the Ethscriptions Protocol:
- TransferEthscription(address indexed recipient, bytes32 indexed ethscriptionTxHash)
- CreateEthscription(address indexed initialOwner, string dataURI)
When a contract emits TransferEthscription, the protocol should register a valid ethscription transfer from the contract to
When a contract emits CreateEthscription, the protocol should register a valid ethscription creation, provided the dataURI is valid and unique. The initial owner will be
Rationale
Ethscriptions can be transferred to any address, which means smart contracts can own them. However, smart contracts cannot currently transfer or create ethscriptions themselves.
This inhibits the creation of protocol-native apps that require smart contracts, such as marketplaces. Further, it makes the protocol difficult to use for smart contract wallet users.
This proposal lays out a simple and low gas mechanism for enabling smart contracts to transfer and create ethscriptions, thereby creating parity between smart contracts and EOAs under the protocol.
Indexing these events across all contracts increases the burden of operating an indexer, but this extra cost is incremental given that indexers must inspect the calldata of every transaction anyway.
⚙️what triggers the creation would be the calldata of the transaction where you told the contract to do that—only that transaction gets a real transaction hash, which is the ethscription id.
@EthSecurity1
Specification
Incorporate two new smart contract events into the Ethscriptions Protocol:
- TransferEthscription(address indexed recipient, bytes32 indexed ethscriptionTxHash)
- CreateEthscription(address indexed initialOwner, string dataURI)
When a contract emits TransferEthscription, the protocol should register a valid ethscription transfer from the contract to
recipient of the ethscription created in transaction hash ethscriptionTxHash, provided the contract owns that ethscription when emitting the event.When a contract emits CreateEthscription, the protocol should register a valid ethscription creation, provided the dataURI is valid and unique. The initial owner will be
initialOwner.Rationale
Ethscriptions can be transferred to any address, which means smart contracts can own them. However, smart contracts cannot currently transfer or create ethscriptions themselves.
This inhibits the creation of protocol-native apps that require smart contracts, such as marketplaces. Further, it makes the protocol difficult to use for smart contract wallet users.
This proposal lays out a simple and low gas mechanism for enabling smart contracts to transfer and create ethscriptions, thereby creating parity between smart contracts and EOAs under the protocol.
Indexing these events across all contracts increases the burden of operating an indexer, but this extra cost is incremental given that indexers must inspect the calldata of every transaction anyway.
⚙️what triggers the creation would be the calldata of the transaction where you told the contract to do that—only that transaction gets a real transaction hash, which is the ethscription id.
@EthSecurity1
⚡2❤1
Bridge Bug Tracker https://github.com/0xDatapunk/Bridge-Bug-Tracker
Alloy: Fast, battle-tested and well-documented building blocks for Ethereum, in Rust https://github.com/alloy-rs/core/releases/tag/v0.2.0
@EthSecurity1
Alloy: Fast, battle-tested and well-documented building blocks for Ethereum, in Rust https://github.com/alloy-rs/core/releases/tag/v0.2.0
@EthSecurity1
GitHub
GitHub - 0xDatapunk/Bridge-Bug-Tracker: Hacks/Vulns/Audits Compilation
Hacks/Vulns/Audits Compilation. Contribute to 0xDatapunk/Bridge-Bug-Tracker development by creating an account on GitHub.
👍3
Vulnerability Detection with Automatic Semantical Oracles
Finding Permission Bugs in Smart Contracts with Role Mining Access Control
AChecker: Statically Detecting Smart Contract Access Control Vulnerabilities Access Control
@EthSecurity1
Finding Permission Bugs in Smart Contracts with Role Mining Access Control
AChecker: Statically Detecting Smart Contract Access Control Vulnerabilities Access Control
@EthSecurity1
Last week, Shido Global was exploited on BSC through a flash loan attack, allowing the attacker to steal around 977 WBNB from the pool. https://explorer.phalcon.xyz/tx/bsc/0x72f8dd2bcfe2c9fbf0d933678170417802ac8a0d8995ff9a56bfbabe3aa712d6I
@EthSecurity1
@EthSecurity1
🔥4😢1
Mastering Fuzzing
https://github.com/Elpacos/mastering-fuzzing
It provides several practical examples of fuzzing using both Echidna & Foundry, two popular property based testing tools @EthSecurity1
https://github.com/Elpacos/mastering-fuzzing
It provides several practical examples of fuzzing using both Echidna & Foundry, two popular property based testing tools @EthSecurity1
GitHub
GitHub - Elpacos/mastering-fuzzing: Practical fuzzing examples for the mastering fuzzing talk
Practical fuzzing examples for the mastering fuzzing talk - Elpacos/mastering-fuzzing
❤3
These results are from a 1-hour long bot-race & not a full-fledged audit.
Wake up to the reality anon, ChatGPT & bots will soon eradicate the lower rungs of bugs from any codebase.
Only the auditors that dare to dive deep will survive this battlefield.
https://gist.github.com/liveactionllama/27513952718ec3cbcf9de0fda7fef49c
@Ethsecurity1
Wake up to the reality anon, ChatGPT & bots will soon eradicate the lower rungs of bugs from any codebase.
Only the auditors that dare to dive deep will survive this battlefield.
https://gist.github.com/liveactionllama/27513952718ec3cbcf9de0fda7fef49c
@Ethsecurity1
Gist
Winning bot race submission
Winning bot race submission. GitHub Gist: instantly share code, notes, and snippets.
❤5
This POC shows you how to perform view-only reentrancy
Just copy paste the code into your tests as an integration test
For Auditors: Apply the check to test if an oracle is safe or not (test against all uses, see sturdy) https://github.com/sherlock-audit/2022-12-sentiment-judging/issues/7
@EthSecurity1
Just copy paste the code into your tests as an integration test
For Auditors: Apply the check to test if an oracle is safe or not (test against all uses, see sturdy) https://github.com/sherlock-audit/2022-12-sentiment-judging/issues/7
@EthSecurity1
GitHub
GalloDaSballo - H-01 wstETH-ETH Curve LP Token Price can be manipulated to Cause Unexpected Liquidations · Issue #7 · sherlock…
GalloDaSballo high H-01 wstETH-ETH Curve LP Token Price can be manipulated to Cause Unexpected Liquidations Summary The wsteETH-ETH LP token is priced via it's virtual_price Through what Chaina...
❤2
poly chain hack https://dedaub.com/blog/poly-chain-hack-postmortem
security alerts channel because of twitter restriction https://t.me/web3_security_alerts @EthSecurity1
security alerts channel because of twitter restriction https://t.me/web3_security_alerts @EthSecurity1
Dedaub
Poly Network Hack Postmortem
Poly Network Hack | GPTPoly Network's $34b notional hack on July 2, 2023, was due to misused private keys, not a smart contract bug.
❤2
EthSecurity
Vulnerability Detection with Automatic Semantical Oracles Finding Permission Bugs in Smart Contracts with Role Mining Access Control AChecker: Statically Detecting Smart Contract Access Control Vulnerabilities Access Control @EthSecurity1
Vulnerability Detection with Automatic Semantical Oracles
Towards Automated Verification of Smart Contract Fairness Fairness Property
Clockwork Finance: Automated Analysis of Economic Security in Smart Contracts @EthSecurity1
Towards Automated Verification of Smart Contract Fairness Fairness Property
Clockwork Finance: Automated Analysis of Economic Security in Smart Contracts @EthSecurity1
❤3👍3
common Smart contract vulnerabilities by Raiders
https://blog.web3sec.news/posts/common-smart-contract-vulnerabilities-audit-checklist/
https://crosschainriskframework.github.io
Crosschain Risk Framework @EthSecurity1
https://blog.web3sec.news/posts/common-smart-contract-vulnerabilities-audit-checklist/
https://crosschainriskframework.github.io
Crosschain Risk Framework @EthSecurity1
❤6👍1