-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from thirdweb-dev/yash/modular-pay-gateway
Modular pay gateway + audit fixes
- Loading branch information
Showing
14 changed files
with
377 additions
and
307 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
[submodule "lib/forge-std"] | ||
path = lib/forge-std | ||
url = https://github.com/foundry-rs/forge-std | ||
[submodule "lib/openzeppelin-contracts"] | ||
path = lib/openzeppelin-contracts | ||
url = https://github.com/OpenZeppelin/openzeppelin-contracts | ||
[submodule "lib/modular-contracts"] | ||
path = lib/modular-contracts | ||
url = https://github.com/thirdweb-dev/modular-contracts | ||
[submodule "lib/solady"] | ||
path = lib/solady | ||
url = https://github.com/vectorized/solady |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,15 @@ | ||
No files changed, compilation skipped | ||
|
||
Running 2 tests for test/benchmarks/BenchmarkPaymentsGatewaySplit.t.sol:BenchmarkPaymentsGatewaySplitTest | ||
[32m[PASS][0m test_startTransfer_erc20() (gas: 131301) | ||
[32m[PASS][0m test_startTransfer_nativeToken() (gas: 141479) | ||
Test result: [32mok[0m. [32m2[0m passed; [31m0[0m failed; [33m0[0m skipped; finished in 1.69ms | ||
Ran 2 tests for test/benchmarks/BenchmarkModularPaymentsGateway.t.sol:BenchmarkModularPaymentsGatewayTest | ||
[PASS] test_initiateTokenPurchase_erc20() (gas: 181350) | ||
[PASS] test_initiateTokenPurchase_nativeToken() (gas: 246176) | ||
Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 1.83ms (777.63µs CPU time) | ||
|
||
Running 2 tests for test/benchmarks/BenchmarkPaymentsGateway.t.sol:BenchmarkPaymentsGatewayTest | ||
[32m[PASS][0m test_startTransfer_erc20() (gas: 158244) | ||
[32m[PASS][0m test_startTransfer_nativeToken() (gas: 183194) | ||
Test result: [32mok[0m. [32m2[0m passed; [31m0[0m failed; [33m0[0m skipped; finished in 1.94ms | ||
Ran 2 tests for test/benchmarks/BenchmarkPaymentsGateway.t.sol:BenchmarkPaymentsGatewayTest | ||
[PASS] test_initiateTokenPurchase_erc20() (gas: 150635) | ||
[PASS] test_initiateTokenPurchase_nativeToken() (gas: 209936) | ||
Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 1.83ms (1.01ms CPU time) | ||
|
||
Running 2 tests for test/benchmarks/BenchmarkPaymentsGatewayPull.t.sol:BenchmarkPaymentsGatewayPullTest | ||
[32m[PASS][0m test_startTransfer_erc20() (gas: 184188) | ||
[32m[PASS][0m test_startTransfer_nativeToken() (gas: 181962) | ||
Test result: [32mok[0m. [32m2[0m passed; [31m0[0m failed; [33m0[0m skipped; finished in 1.81ms | ||
|
||
|
||
Ran 3 test suites: [32m6[0m tests passed, [31m0[0m failed, [33m0[0m skipped (6 total tests) | ||
test_startTransfer_erc20() (gas: 0 (0.000%)) | ||
test_startTransfer_nativeToken() (gas: 0 (0.000%)) | ||
test_startTransfer_erc20() (gas: 0 (0.000%)) | ||
test_startTransfer_nativeToken() (gas: 0 (0.000%)) | ||
test_startTransfer_erc20() (gas: 0 (0.000%)) | ||
test_startTransfer_nativeToken() (gas: 0 (0.000%)) | ||
Overall gas change: 0 (0.000%) | ||
Ran 2 test suites in 2.70ms (3.65ms CPU time): 4 tests passed, 0 failed, 0 skipped (4 total tests) | ||
Overall gas change: 0 (NaN%) |
Binary file not shown.
Submodule modular-contracts
added at
99e6e5
Submodule openzeppelin-contracts
deleted from
01ef44
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
pragma solidity ^0.8.22; | ||
|
||
import { ModularCore } from "lib/modular-contracts/src/ModularCore.sol"; | ||
|
||
contract PayGateway is ModularCore { | ||
constructor(address _owner, address[] memory _modules, bytes[] memory _moduleInstallData) { | ||
_initializeOwner(_owner); | ||
|
||
// Install and initialize modules | ||
require(_modules.length == _moduleInstallData.length); | ||
for (uint256 i = 0; i < _modules.length; i++) { | ||
_installModule(_modules[i], _moduleInstallData[i]); | ||
} | ||
} | ||
|
||
function getSupportedCallbackFunctions() | ||
public | ||
pure | ||
override | ||
returns (SupportedCallbackFunction[] memory supportedCallbackFunctions) | ||
{} | ||
} |
Oops, something went wrong.