artemis icon indicating copy to clipboard operation
artemis copied to clipboard

Port The Strategy to Huff

Open refcell opened this issue 1 year ago • 4 comments

Common @FrankieIsLost, we all know the closed source one uses huff, let's add a huff strategy here 🤠

refcell avatar May 04 '23 17:05 refcell

image

clabby avatar May 04 '23 17:05 clabby

👀

0xClandestine avatar May 05 '23 04:05 0xClandestine

my huff skills are not quite up to the task, but would love to see some huff in the repo! @refcell is there any tooling for generating rust bindings for huff, or do people usually roll their own?

If anyone is interesting in writing a huff strategy, please ping me, happy to help get it across the line.

FrankieIsLost avatar May 05 '23 15:05 FrankieIsLost

@FrankieIsLost

re huff-rust bindings: it depends. huff does include syntax for generating a json abi compatible with solc. however, it is common for huff contracts to include non-standard abi encoding schemes. bc of this, devs usually roll their own encoding.

re porting the sudo x opensea strat to huff : implementing it in accordance with the solc abi spec means we could just pass the deployed address into the cli with no compatibility issues

the questions/issues around this are:

  1. adding this to the repo either requires we hard code the huffc output or implicitly add huffc as a dependency to the arb contract directory. is there a preference between the two? note that the latter also requires ffi to be enabled for testing to pass.
  2. huff opens up a notable attack surface that solc abstracts away. currently the contract has a single test but migrating to huff demands a lot more contract tests given the risk.

if this is something that seems fit to add to the repo, i'd be happy to make a pr with the huffc contract.

jtriley-eth avatar Jun 03 '23 03:06 jtriley-eth

re huff-rust bindings: it depends. huff does include syntax for generating a json abi compatible with solc. however, it is common for huff contracts to include non-standard abi encoding schemes. bc of this, devs usually roll their own encoding.

ah makes sense!

adding this to the repo either requires we hard code the huffc output or implicitly add huffc as a dependency to the arb contract directory. is there a preference between the two? note that the latter also requires ffi to be enabled for testing to pass.

Adding huffc as a dependency to the arb repo isn't a problem. What do you mean by hard code the huffc output? Taking the huffc output using something like forge etch to set it to a specific address? Seems a bit clunky but would prefer it to enabling FFI in the repo. Maybe there's a middle ground where we can run a setup script in CI to deploy the bytecode before running the tests instead of the broad FFI perms.

huff opens up a notable attack surface that solc abstracts away. currently the contract has a single test but migrating to huff demands a lot more contract tests given the risk.

Agree, and I'd be happy to help write some more tests here if helpful.

Overall, would love to see a huff implementation, and happy to support wherever helpful to see it happen :)

FrankieIsLost avatar Jun 06 '23 20:06 FrankieIsLost