Skip to content

Commit

Permalink
fix: Allow fee withdrawal to owner's address (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
OT-kraftchain authored Feb 18, 2025
1 parent 73bf39d commit 3451dad
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/forge-std
2 changes: 1 addition & 1 deletion lib/openzeppelin-contracts
Submodule openzeppelin-contracts updated 87 files
+0 βˆ’5 .changeset/brave-islands-sparkle.md
+0 βˆ’5 .changeset/cyan-taxis-travel.md
+0 βˆ’5 .changeset/famous-timers-compare.md
+0 βˆ’5 .changeset/good-cameras-serve.md
+0 βˆ’5 .changeset/long-walls-draw.md
+0 βˆ’5 .changeset/seven-insects-taste.md
+0 βˆ’5 .changeset/ten-fishes-fold.md
+0 βˆ’5 .changeset/thin-eels-cross.md
+8 βˆ’0 .githooks/pre-push
+5 βˆ’1 .github/workflows/checks.yml
+1 βˆ’1 .github/workflows/formal-verification.yml
+0 βˆ’2 .husky/pre-commit
+1 βˆ’1 CHANGELOG.md
+ βˆ’ audits/2024-12-v5.2.pdf
+8 βˆ’9 audits/README.md
+18 βˆ’26 certora/run.js
+1 βˆ’1 contracts/access/AccessControl.sol
+10 βˆ’3 contracts/account/utils/draft-ERC4337Utils.sol
+6 βˆ’19 contracts/governance/Governor.sol
+1 βˆ’14 contracts/governance/IGovernor.sol
+2 βˆ’2 contracts/governance/README.adoc
+0 βˆ’76 contracts/governance/extensions/GovernorSequentialProposalId.sol
+1 βˆ’1 contracts/governance/extensions/GovernorTimelockCompound.sol
+0 βˆ’123 contracts/interfaces/draft-IERC6909.sol
+1 βˆ’4 contracts/metatx/ERC2771Forwarder.sol
+0 βˆ’39 contracts/mocks/governance/GovernorSequentialProposalIdMock.sol
+5 βˆ’5 contracts/token/ERC20/extensions/ERC4626.sol
+1 βˆ’1 contracts/token/ERC721/README.adoc
+0 βˆ’24 contracts/utils/Calldata.sol
+2 βˆ’11 contracts/utils/README.adoc
+1 βˆ’1 contracts/utils/ReentrancyGuardTransient.sol
+2 βˆ’2 contracts/utils/cryptography/MessageHashUtils.sol
+57 βˆ’49 contracts/utils/math/Math.sol
+2 βˆ’2 contracts/utils/structs/MerkleTree.sol
+1 βˆ’1 docs/modules/ROOT/pages/access-control.adoc
+1 βˆ’1 docs/modules/ROOT/pages/erc1155.adoc
+1 βˆ’1 docs/modules/ROOT/pages/index.adoc
+1 βˆ’1 fv-requirements.txt
+0 βˆ’31 hardhat/common-contracts.js
+1 βˆ’1 lib/forge-std
+88 βˆ’882 package-lock.json
+7 βˆ’19 package.json
+0 βˆ’2 scripts/checks/coverage.sh
+1 βˆ’1 scripts/checks/inheritance-ordering.js
+1 βˆ’1 scripts/checks/pragma-consistency.js
+1 βˆ’1 scripts/generate/templates/Checkpoints.t.js
+4 βˆ’4 scripts/generate/templates/SlotDerivation.t.js
+1 βˆ’1 scripts/prepare-docs.sh
+5 βˆ’0 scripts/prepare.sh
+0 βˆ’10 scripts/set-max-old-space-size.sh
+1 βˆ’4 scripts/solhint-custom/package.json
+2 βˆ’1 slither.config.json
+1 βˆ’1 solhint.config.js
+1 βˆ’1 test/TESTING.md
+49 βˆ’48 test/account/utils/draft-ERC4337Utils.test.js
+28 βˆ’31 test/account/utils/draft-ERC7579Utils.test.js
+2 βˆ’6 test/governance/Governor.t.sol
+1 βˆ’1 test/governance/Governor.test.js
+1 βˆ’1 test/governance/extensions/GovernorCountingFractional.test.js
+1 βˆ’1 test/governance/extensions/GovernorERC721.test.js
+1 βˆ’1 test/governance/extensions/GovernorPreventLateQuorum.test.js
+0 βˆ’202 test/governance/extensions/GovernorSequentialProposalId.test.js
+1 βˆ’1 test/governance/extensions/GovernorStorage.test.js
+1 βˆ’1 test/governance/extensions/GovernorTimelockAccess.test.js
+1 βˆ’1 test/governance/extensions/GovernorTimelockCompound.test.js
+1 βˆ’1 test/governance/extensions/GovernorTimelockControl.test.js
+1 βˆ’1 test/governance/extensions/GovernorVotesQuorumFraction.test.js
+1 βˆ’1 test/governance/extensions/GovernorWithParams.test.js
+31 βˆ’0 test/helpers/erc4337-entrypoint.js
+12 βˆ’14 test/helpers/governance.js
+2 βˆ’7 test/helpers/iterate.js
+1 βˆ’1 test/metatx/ERC2771Context.test.js
+3 βˆ’3 test/proxy/Clones.t.sol
+3 βˆ’3 test/utils/Arrays.t.sol
+2 βˆ’2 test/utils/Base64.t.sol
+0 βˆ’22 test/utils/Calldata.test.js
+1 βˆ’1 test/utils/Create2.t.sol
+25 βˆ’25 test/utils/Nonces.behavior.js
+6 βˆ’6 test/utils/ShortStrings.t.sol
+14 βˆ’14 test/utils/SlotDerivation.t.sol
+4 βˆ’4 test/utils/Strings.t.sol
+2 βˆ’2 test/utils/cryptography/P256.t.sol
+33 βˆ’45 test/utils/introspection/SupportsInterface.behavior.js
+16 βˆ’16 test/utils/math/Math.t.sol
+7 βˆ’7 test/utils/math/SignedMath.t.sol
+3 βˆ’3 test/utils/structs/Checkpoints.t.sol
+1 βˆ’1 test/utils/structs/Heap.t.sol
2 changes: 1 addition & 1 deletion lib/openzeppelin-contracts-upgradeable
Submodule openzeppelin-contracts-upgradeable updated 83 files
+0 βˆ’5 .changeset/brave-islands-sparkle.md
+0 βˆ’5 .changeset/cyan-taxis-travel.md
+0 βˆ’5 .changeset/famous-timers-compare.md
+0 βˆ’5 .changeset/good-cameras-serve.md
+0 βˆ’5 .changeset/long-walls-draw.md
+0 βˆ’5 .changeset/seven-insects-taste.md
+0 βˆ’5 .changeset/ten-fishes-fold.md
+0 βˆ’5 .changeset/thin-eels-cross.md
+8 βˆ’0 .githooks/pre-push
+5 βˆ’1 .github/workflows/checks.yml
+1 βˆ’1 .github/workflows/formal-verification.yml
+1 βˆ’1 .gitmodules
+0 βˆ’2 .husky/pre-commit
+1 βˆ’1 CHANGELOG.md
+ βˆ’ audits/2024-12-v5.2.pdf
+8 βˆ’9 audits/README.md
+18 βˆ’26 certora/run.js
+1 βˆ’1 contracts/access/AccessControlUpgradeable.sol
+6 βˆ’19 contracts/governance/GovernorUpgradeable.sol
+2 βˆ’2 contracts/governance/README.adoc
+0 βˆ’98 contracts/governance/extensions/GovernorSequentialProposalIdUpgradeable.sol
+1 βˆ’1 contracts/governance/extensions/GovernorTimelockCompoundUpgradeable.sol
+1 βˆ’4 contracts/metatx/ERC2771ForwarderUpgradeable.sol
+0 βˆ’7 contracts/mocks/WithInit.sol
+0 βˆ’45 contracts/mocks/governance/GovernorSequentialProposalIdMockUpgradeable.sol
+8 βˆ’5 contracts/token/ERC20/extensions/ERC4626Upgradeable.sol
+1 βˆ’1 contracts/token/ERC721/README.adoc
+2 βˆ’11 contracts/utils/README.adoc
+1 βˆ’1 contracts/utils/ReentrancyGuardTransientUpgradeable.sol
+1 βˆ’1 docs/modules/ROOT/pages/access-control.adoc
+1 βˆ’1 docs/modules/ROOT/pages/erc1155.adoc
+1 βˆ’1 docs/modules/ROOT/pages/index.adoc
+1 βˆ’1 fv-requirements.txt
+0 βˆ’31 hardhat/common-contracts.js
+1 βˆ’1 lib/forge-std
+1 βˆ’1 lib/openzeppelin-contracts
+88 βˆ’882 package-lock.json
+7 βˆ’19 package.json
+0 βˆ’2 scripts/checks/coverage.sh
+1 βˆ’1 scripts/checks/inheritance-ordering.js
+1 βˆ’1 scripts/checks/pragma-consistency.js
+1 βˆ’1 scripts/generate/templates/Checkpoints.t.js
+4 βˆ’4 scripts/generate/templates/SlotDerivation.t.js
+1 βˆ’1 scripts/prepare-docs.sh
+5 βˆ’0 scripts/prepare.sh
+0 βˆ’10 scripts/set-max-old-space-size.sh
+1 βˆ’4 scripts/solhint-custom/package.json
+2 βˆ’1 slither.config.json
+1 βˆ’1 solhint.config.js
+1 βˆ’1 test/TESTING.md
+49 βˆ’48 test/account/utils/draft-ERC4337Utils.test.js
+28 βˆ’31 test/account/utils/draft-ERC7579Utils.test.js
+2 βˆ’6 test/governance/Governor.t.sol
+1 βˆ’1 test/governance/Governor.test.js
+1 βˆ’1 test/governance/extensions/GovernorCountingFractional.test.js
+1 βˆ’1 test/governance/extensions/GovernorERC721.test.js
+1 βˆ’1 test/governance/extensions/GovernorPreventLateQuorum.test.js
+0 βˆ’202 test/governance/extensions/GovernorSequentialProposalId.test.js
+1 βˆ’1 test/governance/extensions/GovernorStorage.test.js
+1 βˆ’1 test/governance/extensions/GovernorTimelockAccess.test.js
+1 βˆ’1 test/governance/extensions/GovernorTimelockCompound.test.js
+1 βˆ’1 test/governance/extensions/GovernorTimelockControl.test.js
+1 βˆ’1 test/governance/extensions/GovernorVotesQuorumFraction.test.js
+1 βˆ’1 test/governance/extensions/GovernorWithParams.test.js
+31 βˆ’0 test/helpers/erc4337-entrypoint.js
+12 βˆ’14 test/helpers/governance.js
+2 βˆ’7 test/helpers/iterate.js
+1 βˆ’1 test/metatx/ERC2771Context.test.js
+3 βˆ’3 test/proxy/Clones.t.sol
+3 βˆ’3 test/utils/Arrays.t.sol
+2 βˆ’2 test/utils/Base64.t.sol
+0 βˆ’22 test/utils/Calldata.test.js
+1 βˆ’1 test/utils/Create2.t.sol
+25 βˆ’25 test/utils/Nonces.behavior.js
+6 βˆ’6 test/utils/ShortStrings.t.sol
+14 βˆ’14 test/utils/SlotDerivation.t.sol
+4 βˆ’4 test/utils/Strings.t.sol
+2 βˆ’2 test/utils/cryptography/P256.t.sol
+33 βˆ’45 test/utils/introspection/SupportsInterface.behavior.js
+16 βˆ’16 test/utils/math/Math.t.sol
+7 βˆ’7 test/utils/math/SignedMath.t.sol
+3 βˆ’3 test/utils/structs/Checkpoints.t.sol
+1 βˆ’1 test/utils/structs/Heap.t.sol
11 changes: 11 additions & 0 deletions src/main/solidity/GrantSharesRelayer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ import {Ownable2StepUpgradeable} from "@openzeppelin/contracts-upgradeable/acces
import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import {PausableUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol";
import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
import {Address} from "@openzeppelin/contracts/utils/Address.sol";

contract GrantSharesRelayer is Ownable2StepUpgradeable, PausableUpgradeable, UUPSUpgradeable {
using Address for address payable;

//0xfc512fde
error InvalidPaymentAmount();

Expand Down Expand Up @@ -90,6 +93,14 @@ contract GrantSharesRelayer is Ownable2StepUpgradeable, PausableUpgradeable, UUP
return _getGSStorage();
}

/**
* @dev Withdraws the fees accumulated in the contract to the owner's address
*/
function withdrawFees() external onlyOwner {
// no reentrancy guard b/c owner is trusted
payable(owner()).sendValue(address(this).balance);
}

/**
* @dev Pauses the contract
*/
Expand Down

0 comments on commit 3451dad

Please sign in to comment.