huff-language / huffmate

A library of modern, hyper-optimized, and extensible Huff contracts with extensive testing and documentation built by Huff maintainers.
https://github.com/pentagonxyz/huffmate
MIT License
437 stars 55 forks source link

feat: OnlyContract Modifier Macro #27

Closed refcell closed 2 years ago

refcell commented 2 years ago

Overview

Introduces an ONLY_CONTRACT macro that reverts when tx.origin == msg.sender.

Warning This is a naive check that the sender is a contract address and is generally seen as an anti-pattern. Additionally, this breaks contract interoperability and breaks once account abstraction is implemented.

0xsomnus commented 2 years ago

Gonna review this too if you'll have me, sers