Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add integration tests for DAO transactions #44

Merged
merged 14 commits into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions contracts/forwarder/CrossExecutor.sol
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ contract CrossExecutor is IERC777Recipient, Context, Ownable {
bytes calldata /*_operatorData*/
) external override {
if (_msgSender() == token && _from == sender) {
(, bytes memory callsAndTargets, , address originAddress, , , , ) = abi.decode(
(, bytes memory callsAndTargets, , address originAddress) = abi.decode(
_metaData,
(bytes1, bytes, bytes4, address, bytes4, address, bytes, bytes)
(bytes1, bytes, bytes4, address)
);

if (!_whitelistedOriginAddresses[originAddress]) {
Expand Down Expand Up @@ -74,4 +74,8 @@ contract CrossExecutor is IERC777Recipient, Context, Ownable {
function whitelistOriginAddress(address originAddress) external onlyOwner {
_whitelistedOriginAddresses[originAddress] = true;
}

function dewhitelistOriginAddress(address originAddress) external onlyOwner {
delete _whitelistedOriginAddresses[originAddress];
}
}
4 changes: 2 additions & 2 deletions contracts/forwarder/ForwarderNative.sol
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ contract ForwarderNative is IForwarder, IERC777Recipient, Context, Ownable {
bytes calldata /*_operatorData*/
) external override {
if (_msgSender() == token && _from == vault) {
(, bytes memory userData, , address originAddress, , , , ) = abi.decode(
(, bytes memory userData, , address originAddress) = abi.decode(
_userData,
(bytes1, bytes, bytes4, address, bytes4, address, bytes, bytes)
(bytes1, bytes, bytes4, address)
);

(bytes memory callsAndTargets, address caller) = abi.decode(
Expand Down
3 changes: 2 additions & 1 deletion hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ module.exports = {
apiKey: {
mainnet: getEnvironmentVariable('ETHERSCAN_API_KEY'),
polygon: getEnvironmentVariable('POLYGONSCAN_API_KEY'),
xdai: getEnvironmentVariable('GNOSISSCAN_API_KEY')
xdai: getEnvironmentVariable('GNOSISSCAN_API_KEY'),
bsc: getEnvironmentVariable('BSCSCAN_API_KEY')
}
},
gasReporter: {
Expand Down
Loading