I'm having trouble testing deployment of my contract that links an external library.
when I run forge clean && forge test --ffi --via-ir -vvv , I get this output:
[FAIL. Reason: setup failed: data did not match any variant of untagged enum Bytecode at line 1 column 95970] setUp()
I have tried:
enabling the options flag for external-library-linking
verifying the build info with this command (SUCCESS):
forge clean && forge build && npx @openzeppelin/upgrades-core@^1.31.0 validate out/build-info --contract PoolManager
writing the annotation
/// @custom:oz-upgrades-unsafe-allow external-library-linking
contract PoolManager is ...
Below is my setup code:
//test/PoolManager.t.sol
function setUp() public {
pixelMerkle = new PixelMerkle(address(this));
pixelOracle = new PixelOracle(address(pixelMerkle));
weth = new WETH();
Options memory options;
options.unsafeAllow = "external-library-linking";
address proxy = Upgrades.deployUUPSProxy(
"PoolManager.sol:PoolManager",
abi.encodeCall(PoolManager.initialize, (address(pixelOracle), address(weth))),
options
);
in the PoolManager.sol file here is my deployment code:
function initialize(address _oracle, address _WETH) public payable initializer {
oracle = _oracle;
WETH = _WETH;
__Ownable_init(msg.sender);
__ReentrancyGuard_init();
}
function _authorizeUpgrade(address newImplementation) internal override onlyOwner { }
I dont have a constructor in my contract, just trying to deploy.
Have I got things setup correctly? I would appreciate any help, thanks!