-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
import package for reference tests + feat/remove-allowed-token-entrie…
…s-on-contract + dev notes + basic test setup in foundry
- Loading branch information
1 parent
8307da6
commit b4ac466
Showing
9 changed files
with
91 additions
and
58 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
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
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 |
---|---|---|
@@ -0,0 +1,63 @@ | ||
// SPDX-License-Identifier: Unlicense | ||
pragma solidity >=0.8.0; | ||
|
||
import {DSTest} from "ds-test/test.sol"; | ||
import {OracleAggregator} from "../../contracts/token/oracles/OracleAggregator.sol"; | ||
import {IOracleAggregator} from "../../contracts/token/oracles/IOracleAggregator.sol"; | ||
import {BiconomyTokenPaymaster} from "../../contracts/token/BiconomyTokenPaymaster.sol"; | ||
import "@account-abstraction/contracts/core/EntryPoint.sol"; | ||
import {Utilities} from "./utils/Utilities.sol"; | ||
import {console} from "./utils/Console.sol"; | ||
import {Vm} from "forge-std/Vm.sol"; | ||
|
||
contract ContractTest is DSTest { | ||
Vm internal immutable vm = Vm(HEVM_ADDRESS); | ||
|
||
Utilities internal utils; | ||
address payable[] internal users; | ||
|
||
OracleAggregator _oa; | ||
BiconomyTokenPaymaster _btpm; | ||
EntryPoint _ep; | ||
|
||
function setUp() public { | ||
utils = new Utilities(); | ||
users = utils.createUsers(5); | ||
} | ||
|
||
function testCreateOA() public { | ||
|
||
address payable alice = users[0]; | ||
// labels alice's address in call traces as "Alice [<address>]" | ||
vm.label(alice, "Alice"); | ||
|
||
address payable bob = users[1]; | ||
vm.label(bob, "Bob"); | ||
|
||
_oa = new OracleAggregator(alice); | ||
|
||
assertEq(_oa.owner(),alice); | ||
|
||
vm.prank(alice); | ||
} | ||
|
||
function testCreateTokenPaymaster() public { | ||
|
||
address payable alice = users[0]; | ||
// labels alice's address in call traces as "Alice [<address>]" | ||
vm.label(alice, "Alice"); | ||
|
||
address payable bob = users[1]; | ||
vm.label(bob, "Bob"); | ||
|
||
_oa = new OracleAggregator(alice); | ||
_ep = new EntryPoint(); | ||
_btpm = new BiconomyTokenPaymaster(alice, _ep, bob, _oa); | ||
|
||
assertEq(_oa.owner(),alice); | ||
assertEq(_btpm.owner(),alice); | ||
assertEq(_btpm.verifyingSigner(),bob); | ||
|
||
vm.prank(alice); | ||
} | ||
} |
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 |
---|---|---|
|
@@ -978,7 +978,7 @@ | |
resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-4.8.1.tgz#709cfc4bbb3ca9f4460d60101f15dac6b7a2d5e4" | ||
integrity sha512-xQ6eUZl+RDyb/FiZe1h+U7qr/f4p/SrTSQcTPH2bjur3C5DbuW/zFgCU/b1P/xcIaEqJep+9ju4xDRi3rmChdQ== | ||
|
||
"@openzeppelin/contracts@^4.7.3": | ||
"@openzeppelin/contracts@^4.7.3", "@openzeppelin/contracts@^4.8.2": | ||
version "4.8.3" | ||
resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-4.8.3.tgz#cbef3146bfc570849405f59cba18235da95a252a" | ||
integrity sha512-bQHV8R9Me8IaJoJ2vPG4rXcL7seB7YVuskr4f+f5RyOStSZetwzkWtoqDMl5erkBJy0lDRUnIR2WIkPiC0GJlg== | ||
|
@@ -988,6 +988,20 @@ | |
resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-4.3.3.tgz#ff6ee919fc2a1abaf72b22814bfb72ed129ec137" | ||
integrity sha512-tDBopO1c98Yk7Cv/PZlHqrvtVjlgK5R4J6jxLwoO7qxK4xqOiZG+zSkIvGFpPZ0ikc3QOED3plgdqjgNTnBc7g== | ||
|
||
"@pimlico/erc20-paymaster@^0.0.1": | ||
version "0.0.1" | ||
resolved "https://registry.yarnpkg.com/@pimlico/erc20-paymaster/-/erc20-paymaster-0.0.1.tgz#d9c827f3f6c2c553870597a5dc3e1398967d7790" | ||
integrity sha512-L7xJce76sxUK88lFqKI0J1BiQRa9cgj233Qke3rEOCzncG8Gl4Lx+/89/jWiqNbdyfHtjD4Dn2PKLyBj27ypxg== | ||
dependencies: | ||
"@account-abstraction/contracts" "^0.6.0" | ||
"@account-abstraction/utils" "^0.5.0" | ||
"@ethersproject/abstract-provider" "^5.7.0" | ||
"@ethersproject/providers" "^5.7.2" | ||
"@openzeppelin/contracts" "^4.8.2" | ||
ethers "^5.7.2" | ||
hardhat "^2.13.0" | ||
solady "^0.0.90" | ||
|
||
"@scure/base@~1.1.0": | ||
version "1.1.1" | ||
resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.1.1.tgz#ebb651ee52ff84f420097055f4bf46cfba403938" | ||
|
@@ -3251,7 +3265,7 @@ ethers@^4.0.40: | |
uuid "2.0.1" | ||
xmlhttprequest "1.8.0" | ||
|
||
ethers@^5.6.8, ethers@^5.7.0, ethers@^5.7.1: | ||
ethers@^5.6.8, ethers@^5.7.0, ethers@^5.7.1, ethers@^5.7.2: | ||
version "5.7.2" | ||
resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.7.2.tgz#3a7deeabbb8c030d4126b24f84e525466145872e" | ||
integrity sha512-wswUsmWo1aOK8rR7DIKiWSw9DbLWe6x98Jrn8wcTflTVvaXhAMaB5zGAXy0GYQEQp9iO1iSHWVyARQm11zUtyg== | ||
|
@@ -4016,7 +4030,7 @@ hardhat-gas-reporter@^1.0.7: | |
eth-gas-reporter "^0.2.25" | ||
sha1 "^1.1.1" | ||
|
||
hardhat@^2.9.5: | ||
hardhat@^2.13.0, hardhat@^2.9.5: | ||
version "2.14.0" | ||
resolved "https://registry.yarnpkg.com/hardhat/-/hardhat-2.14.0.tgz#b60c74861494aeb1b50803cf04cc47865a42b87a" | ||
integrity sha512-73jsInY4zZahMSVFurSK+5TNCJTXMv+vemvGia0Ac34Mm19fYp6vEPVGF3sucbumszsYxiTT2TbS8Ii2dsDSoQ== | ||
|
@@ -6403,6 +6417,11 @@ slice-ansi@^4.0.0: | |
astral-regex "^2.0.0" | ||
is-fullwidth-code-point "^3.0.0" | ||
|
||
solady@^0.0.90: | ||
version "0.0.90" | ||
resolved "https://registry.yarnpkg.com/solady/-/solady-0.0.90.tgz#2075349dfa6909b05ed04031f3b609ddbcd73598" | ||
integrity sha512-NSc0mkfJo2CeKfFfyED1qbBQ8ofvDFxpBb0BLJ/wx2ZN7vCAYl8sp/j6TIIMdPb0BDvOKl2Rie9dVum+KIKeVA== | ||
|
||
[email protected]: | ||
version "0.7.3" | ||
resolved "https://registry.yarnpkg.com/solc/-/solc-0.7.3.tgz#04646961bd867a744f63d2b4e3c0701ffdc7d78a" | ||
|