Skip to content
This repository has been archived by the owner on Apr 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #72 from marc-aurele-besner/dev
Browse files Browse the repository at this point in the history
Fix small issue in deployment and foundry test
  • Loading branch information
marc-aurele-besner authored Feb 19, 2023
2 parents cd75389 + 70ac033 commit f1be716
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 17 deletions.
5 changes: 2 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hardhat-awesome-cli",
"version": "0.1.0",
"version": "0.1.1",
"description": "Hardhat made awesome with a flexible CLI to help run test, deploy and more.",
"repository": "https://github.com/marc-aurele-besner/hardhat-awesome-cli.git",
"author": "Marc-Aurele Besner <82244926+marc-aurele-besner@users.noreply.github.com>",
Expand Down
6 changes: 5 additions & 1 deletion src/buildFoundrySetting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const buildFoundrySetting = async () => {
if (!fs.existsSync('foundry.toml')) {
fs.writeFileSync(
'foundry.toml',
`[default]
`[profile.default]
src = 'contracts/test' # the source directory
test = 'contracts/test' # the test directory
out = 'artifacts/contracts' # the output directory (for artifacts)
Expand Down Expand Up @@ -54,6 +54,10 @@ block_difficulty = 0 # the value of blo
if (!fs.existsSync('contracts/test/utils')) {
fs.mkdirSync('contracts/test/utils')
}
} else {
if (!fs.existsSync('contracts/test/utils')) {
fs.mkdirSync('contracts/test/utils')
}
}
} else {
fs.mkdirSync('contracts')
Expand Down
4 changes: 2 additions & 2 deletions src/mockContracts/scripts/deploy-Mock-ERC1155Upgradeable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { addressBook, ethers, network } from 'hardhat'
async function main() {
const [deployer] = await ethers.getSigners()

const MockERC1155Upgradeable = await ethers.getContractFactory('MockERC1155')
const MockERC1155Upgradeable = await ethers.getContractFactory('MockERC1155Upgradeable')
const mockERC1155Upgradeable = await MockERC1155Upgradeable.deploy()

await mockERC1155Upgradeable.deployed()
Expand All @@ -14,7 +14,7 @@ async function main() {
network.name,
deployer.address
)
await mockERC1155Upgradeable.initialize('MockERC1155', 'MOCK', 'https://google.com')
await mockERC1155Upgradeable.initialize('MockERC1155Upgradeable', 'MOCK', 'https://google.com')

console.log('MockERC1155Upgradeable deployed to:', mockERC1155Upgradeable.address)
}
Expand Down
6 changes: 3 additions & 3 deletions src/mockContracts/testForge/MockERC1155.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ contract MockERC1155Test is DSTest {
uint256 tokenId_,
uint256 amount_
) public {
vm.assume(to_ != address(0));
vm.assume(to_ != address(0) && to_.code.length == 0);
vm.assume(tokenId_ > 0);
vm.assume(amount_ > 0);

Expand All @@ -55,7 +55,7 @@ contract MockERC1155Test is DSTest {
uint256 tokenId_,
uint256 amount_
) public {
vm.assume(to_ != address(0));
vm.assume(to_ != address(0) && to_.code.length == 0);
vm.assume(tokenId_ > 0);
vm.assume(amount_ > 0);

Expand All @@ -77,7 +77,7 @@ contract MockERC1155Test is DSTest {
uint256 tokenId_,
uint256 amount_
) public {
vm.assume(to_ != address(0));
vm.assume(to_ != address(0) && to_.code.length == 0);
vm.assume(tokenId_ > 0);
vm.assume(amount_ > 0);

Expand Down
6 changes: 3 additions & 3 deletions src/mockContracts/testForge/MockERC1155Upgradeable.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ contract MockERC1155UpgradeableTest is DSTest {
uint256 tokenId_,
uint256 amount_
) public {
vm.assume(to_ != address(0));
vm.assume(to_ != address(0) && to_.code.length == 0);
vm.assume(tokenId_ > 0);
vm.assume(amount_ > 0);

Expand All @@ -57,7 +57,7 @@ contract MockERC1155UpgradeableTest is DSTest {
uint256 tokenId_,
uint256 amount_
) public {
vm.assume(to_ != address(0));
vm.assume(to_ != address(0) && to_.code.length == 0);
vm.assume(tokenId_ > 0);
vm.assume(amount_ > 0);

Expand All @@ -79,7 +79,7 @@ contract MockERC1155UpgradeableTest is DSTest {
uint256 tokenId_,
uint256 amount_
) public {
vm.assume(to_ != address(0));
vm.assume(to_ != address(0) && to_.code.length == 0);
vm.assume(tokenId_ > 0);
vm.assume(amount_ > 0);

Expand Down
4 changes: 2 additions & 2 deletions src/mockContracts/testForge/MockERC721.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ contract MockERC721Test is DSTest {
address to_,
uint256 tokenId_
) public {
vm.assume(to_ != address(0));
vm.assume(to_ != address(0) && to_.code.length == 0);
vm.assume(tokenId_ > 0);

assertEq(mockERC721.balanceOf(to_), 0);
Expand All @@ -53,7 +53,7 @@ contract MockERC721Test is DSTest {
address to_,
uint256 tokenId_
) public {
vm.assume(to_ != address(0));
vm.assume(to_ != address(0) && to_.code.length == 0);
vm.assume(tokenId_ > 0);

assertEq(mockERC721.balanceOf(to_), 0);
Expand Down
4 changes: 2 additions & 2 deletions src/mockContracts/testForge/MockERC721Upgradeable.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ contract MockERC721UpgradeableTest is DSTest {
address to_,
uint256 tokenId_
) public {
vm.assume(to_ != address(0));
vm.assume(to_ != address(0) && to_.code.length == 0);
vm.assume(tokenId_ > 0);

assertEq(mockERC721Upgradeable.balanceOf(to_), 0);
Expand All @@ -54,7 +54,7 @@ contract MockERC721UpgradeableTest is DSTest {
address to_,
uint256 tokenId_
) public {
vm.assume(to_ != address(0));
vm.assume(to_ != address(0) && to_.code.length == 0);
vm.assume(tokenId_ > 0);

assertEq(mockERC721Upgradeable.balanceOf(to_), 0);
Expand Down

0 comments on commit f1be716

Please sign in to comment.