Skip to content
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
12 changes: 7 additions & 5 deletions contracts/strategies/_poc/qv-hackathon/SchemaResolver.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ pragma solidity 0.8.19;
// - updated import paths
// - updated _eas to make it mutable
// - replaced constructor __SchemaResolver_init()
// - commented out receive() function
// Reason for change:
// - wanted it to set when HackathonQVStrategy.initialize() is invoked
import {IEAS, Attestation} from "eas-contracts/IEAS.sol";
Expand Down Expand Up @@ -59,11 +60,12 @@ abstract contract SchemaResolver is ISchemaResolver {
/**
* @dev ETH callback.
*/
receive() external payable virtual {
if (!isPayable()) {
revert NotPayable();
}
}
// TODO: Revisit this logic
// receive() external payable virtual {
// if (!isPayable()) {
// revert NotPayable();
// }
// }

/**
* @inheritdoc ISchemaResolver
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -847,6 +847,6 @@ abstract contract DonationVotingMerkleDistributionBaseStrategy is Native, BaseSt
return (rowIndex, colIndex, statusesBitMap[rowIndex]);
}

/// @notice Contract should be able to receive ETH
/// @notice Contract should be able to receive NATIVE
receive() external payable {}
}
3 changes: 3 additions & 0 deletions contracts/strategies/qv-base/QVBaseStrategy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -616,4 +616,7 @@ abstract contract QVBaseStrategy is BaseStrategy {
revert INVALID();
}
}

/// @notice Contract should be able to receive NATIVE
receive() external payable {}
}
4 changes: 2 additions & 2 deletions test/foundry/strategies/HackathonQVStrategy.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ contract HackathonQVStrategyTest is QVBaseStrategyTest, Native {
__setAllowedRecipientId();
}

function _createStrategy() internal override returns (address) {
return address(new HackathonQVStrategy(address(allo()), "MockStrategy"));
function _createStrategy() internal override returns (address payable) {
return payable(address(new HackathonQVStrategy(address(allo()), "MockStrategy")));
}

function hQvStrategy() internal view returns (HackathonQVStrategy) {
Expand Down
8 changes: 4 additions & 4 deletions test/foundry/strategies/QVBaseStrategy.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ contract QVBaseStrategyTest is Test, AlloSetup, RegistrySetupFull, StrategySetup
uint64 public allocationStartTime;
uint64 public allocationEndTime;

address internal _strategy;
address payable internal _strategy;
MockERC20 public token;
Metadata public poolMetadata;

Expand Down Expand Up @@ -93,8 +93,8 @@ contract QVBaseStrategyTest is Test, AlloSetup, RegistrySetupFull, StrategySetup
_initialize();
}

function _createStrategy() internal virtual returns (address) {
return address(new QVBaseStrategyTestMock(address(allo()), "MockStrategy"));
function _createStrategy() internal virtual returns (address payable) {
return payable(address(new QVBaseStrategyTestMock(address(allo()), "MockStrategy")));
}

function _initialize() internal virtual {
Expand Down Expand Up @@ -139,7 +139,7 @@ contract QVBaseStrategyTest is Test, AlloSetup, RegistrySetupFull, StrategySetup

function test_initialize_UNAUTHORIZED() public virtual {
vm.startPrank(allo_owner());
address strategy = address(new QVBaseStrategyTestMock(address(allo()), "MockStrategy"));
address payable strategy = payable(address(new QVBaseStrategyTestMock(address(allo()), "MockStrategy")));
vm.expectRevert(UNAUTHORIZED.selector);
vm.stopPrank();
vm.startPrank(randomAddress());
Expand Down
4 changes: 2 additions & 2 deletions test/foundry/strategies/QVGovernanceERC20Votes.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ contract QVGovernanceERC20VotesTest is QVBaseStrategyTest {
super.setUp();
}

function _createStrategy() internal override returns (address) {
return address(new QVGovernanceERC20Votes(address(allo()), "MockStrategy"));
function _createStrategy() internal override returns (address payable) {
return payable(address(new QVGovernanceERC20Votes(address(allo()), "MockStrategy")));
}

function qvGovStrategy() internal view returns (QVGovernanceERC20Votes) {
Expand Down
4 changes: 2 additions & 2 deletions test/foundry/strategies/QVNftTieredStrategy.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ contract QVNftTieredStrategyTest is QVBaseStrategyTest {
super.setUp();
}

function _createStrategy() internal override returns (address) {
return address(new QVNftTieredStrategy(address(allo()), "MockStrategy"));
function _createStrategy() internal override returns (address payable) {
return payable(address(new QVNftTieredStrategy(address(allo()), "MockStrategy")));
}

function qvNftStrategy() internal view returns (QVNftTieredStrategy) {
Expand Down
4 changes: 2 additions & 2 deletions test/foundry/strategies/QVSimpleStrategy.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ contract QVSimpleStrategyTest is QVBaseStrategyTest {
super.setUp();
}

function _createStrategy() internal override returns (address) {
return address(new QVSimpleStrategy(address(allo()), "MockStrategy"));
function _createStrategy() internal override returns (address payable) {
return payable(address(new QVSimpleStrategy(address(allo()), "MockStrategy")));
}

function _initialize() internal override {
Expand Down