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

include ERC72.huff got duplicate macro name #141

Open boying52 opened 4 months ago

boying52 commented 4 months ago

I got the error of compiling that it told me I have duplicate macro function, when I am writing the huffs with using huffmate, I think the reason is ERC721 included two files that are CommonErros.huff and nonpayable.huff, they all imported the same file that is Errors.huff. My #include visions are following:

MyTest.Huff ---> #include ECR721.huff

or

MyTest.Huff ----> #include hashmap.huff & #include ECR721.huff

above situations can cause the errors that including of duplicate to happen.

MathisGD commented 4 months ago

I believe that this is linked to the change in huffc which raises an error when there are duplicate macros in a compiled file (including imports), while in the past it was possible to do this (it was taking one of the two, probably the first one chonologically). This is what makes tests fail btw (#138). If I have some spare time in the coming days, I will try to fix this because it's ruining the experience with this repo.