Skip to content

Commit

Permalink
fix: tests now working, changing the createProposal to payable and re…
Browse files Browse the repository at this point in the history
…alistic mocks
  • Loading branch information
carlosgj94 committed Mar 23, 2024
1 parent 9ada900 commit e2ae5f2
Show file tree
Hide file tree
Showing 15 changed files with 3,242 additions and 511 deletions.
111 changes: 111 additions & 0 deletions broadcast/OptimisticTokenVotingPlugin.s.sol/80001/run-1711103988.json

Large diffs are not rendered by default.

111 changes: 111 additions & 0 deletions broadcast/OptimisticTokenVotingPlugin.s.sol/80001/run-1711104070.json

Large diffs are not rendered by default.

111 changes: 111 additions & 0 deletions broadcast/OptimisticTokenVotingPlugin.s.sol/80001/run-1711104153.json

Large diffs are not rendered by default.

113 changes: 113 additions & 0 deletions broadcast/OptimisticTokenVotingPlugin.s.sol/80001/run-1711104380.json

Large diffs are not rendered by default.

115 changes: 115 additions & 0 deletions broadcast/OptimisticTokenVotingPlugin.s.sol/80001/run-1711105792.json

Large diffs are not rendered by default.

1,013 changes: 1,013 additions & 0 deletions broadcast/OptimisticTokenVotingPlugin.s.sol/80001/run-1711105799.json

Large diffs are not rendered by default.

110 changes: 110 additions & 0 deletions broadcast/OptimisticTokenVotingPlugin.s.sol/80001/run-1711106310.json

Large diffs are not rendered by default.

995 changes: 995 additions & 0 deletions broadcast/OptimisticTokenVotingPlugin.s.sol/80001/run-1711106317.json

Large diffs are not rendered by default.

884 changes: 433 additions & 451 deletions broadcast/OptimisticTokenVotingPlugin.s.sol/80001/run-latest.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions script/OptimisticTokenVotingPlugin.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ contract OptimisticTokenVotingPluginScript is Script {
// 2. // 2. Publishing it in the Aragon OSx Protocol
PluginRepo pluginRepo = PluginRepoFactory(pluginRepoFactory)
.createPluginRepoWithFirstVersion(
"optimistic-crosschain69",
"optimistic-crosschain72",
address(pluginSetup),
msg.sender,
"0x00", // TODO: Give these actual values on prod
Expand All @@ -58,7 +58,7 @@ contract OptimisticTokenVotingPluginScript is Script {
DAOFactory.DAOSettings memory daoSettings = DAOFactory.DAOSettings(
address(0),
"",
"optimistic-crosschain69", // This should be changed on each deployment
"optimistic-crosschain72", // This should be changed on each deployment
""
);

Expand Down
2 changes: 1 addition & 1 deletion src/IOptimisticTokenVoting.sol
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ interface IOptimisticTokenVoting {
uint256 _allowFailureMap,
uint64 _startDate,
uint64 _endDate
) external returns (uint256 proposalId);
) external payable returns (uint256 proposalId);

/// @notice Checks if an account can participate on an optimistic proposal. This can be because the proposal
/// - has not started,
Expand Down
5 changes: 1 addition & 4 deletions src/L2VetoAggregation.sol
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,7 @@ contract L2VetoAggregation is NonblockingLzApp {
bytes memory remoteAddresses = abi.encodePacked(
_bridgeSettings.l1Plugin
);
setTrustedRemoteAddress(
_bridgeSettings.chainId,
remoteAddresses
);
setTrustedRemoteAddress(_bridgeSettings.chainId, remoteAddresses);
}

// This function is called when data is received. It overrides the equivalent function in the parent contract.
Expand Down
15 changes: 9 additions & 6 deletions src/OptimisticTokenVotingPlugin.sol
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,10 @@ contract OptimisticTokenVotingPlugin is

__LzApp_init(bridgeSettings.bridge);
bytes memory remoteAddresses = abi.encodePacked(
_bridgeSettings.l2VotingAggregator
);
setTrustedRemoteAddress(
_bridgeSettings.chainId,
remoteAddresses
_bridgeSettings.l2VotingAggregator,
address(this)
);
setTrustedRemote(_bridgeSettings.chainId, remoteAddresses);

emit MembershipContractAnnounced({definingContract: address(_token)});
}
Expand Down Expand Up @@ -338,7 +336,12 @@ contract OptimisticTokenVotingPlugin is
uint256 _allowFailureMap,
uint64 _startDate,
uint64 _endDate
) external auth(PROPOSER_PERMISSION_ID) returns (uint256 proposalId) {
)
external
payable
auth(PROPOSER_PERMISSION_ID)
returns (uint256 proposalId)
{
// Check that either `_msgSender` owns enough tokens or has enough voting power from being a delegatee.
{
uint256 minProposerVotingPower_ = governanceSettings
Expand Down
4 changes: 2 additions & 2 deletions src/lzApp/LzApp.sol
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ abstract contract LzApp is
// this function set the trusted path for the cross-chain communication
function setTrustedRemote(
uint16 _remoteChainId,
bytes calldata _path
) external onlyOwner {
bytes memory _path
) internal {
trustedRemoteLookup[_remoteChainId] = _path;
emit SetTrustedRemote(_remoteChainId, _path);
}
Expand Down
Loading

0 comments on commit e2ae5f2

Please sign in to comment.