You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 9, 2024. It is now read-only.
contract Testes is Test {
function setUp() public {
console.log(address(this)); // ==> 0xb4c79dab8f259c7aee6e5b2aa729821864227e84
vm.startPrank(0xBADBABE);
t = HuffDeployer.deploy("ownable");
console.log(t.owner()); // ==> 0xb7ae1a7049f30ecd8ff4d0328206652ecceca25f
}
}
Was testing out TSOwnable.huff which SSTORE's the caller as the owner in the constructor (I've confirmed this in the debugger) and noticed that the deployer address gets lost along the way. The address that gets used is the address of the HuffConfig contract.
I did some sleuthing here are my logs:
Logs:
0xb4c79dab8f259c7aee6e5b2aa729821864227e84, address(this) from setUp() in test before HuffDeployer is run
0x000000000000000000000000000000000badbabe, vm.startPrank(address(0xBADBABE)) called just before HuffDeployer
0xb4c79dab8f259c7aee6e5b2aa729821864227e84, address(this) from HuffDeployer.deploy()
0xb7ae1a7049f30ecd8ff4d0328206652ecceca25f, address(this) from HuffConfig.deploy(), just before create()
0xb7ae1a7049f30ecd8ff4d0328206652ecceca25f, t.owner() from setUp() in test setup after HuffDeployer complete
So it appears that vm.startPrank doesn't work on the call to HuffDeployer, then when HuffDeployer calls HuffConfig, a whole new other address is used for the deployment.
Solution, idk why we lose that pranked address when calling HuffDeployer. If we had access to that, we could just pass it to HuffConfig.deploy and then vm.prank just before we call create. But if we can't get the pranked address in HuffDeployer.deploy then I guess we set up a new config() option to assign deployer or smthg...
The text was updated successfully, but these errors were encountered:
example:
Was testing out TSOwnable.huff which SSTORE's the caller as the owner in the constructor (I've confirmed this in the debugger) and noticed that the deployer address gets lost along the way. The address that gets used is the address of the HuffConfig contract.
I did some sleuthing here are my logs:
So it appears that vm.startPrank doesn't work on the call to HuffDeployer, then when HuffDeployer calls HuffConfig, a whole new other address is used for the deployment.
Solution, idk why we lose that pranked address when calling HuffDeployer. If we had access to that, we could just pass it to HuffConfig.deploy and then vm.prank just before we call
create
. But if we can't get the pranked address in HuffDeployer.deploy then I guess we set up a new config() option to assign deployer or smthg...The text was updated successfully, but these errors were encountered: