Skip to content

Commit

Permalink
Merge pull request #44 from pnetwork-association/test/dao
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviera9 authored Mar 7, 2024
2 parents 15124a3 + 1945b41 commit acf2cfd
Show file tree
Hide file tree
Showing 8 changed files with 1,775 additions and 38 deletions.
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

0 comments on commit acf2cfd

Please sign in to comment.