Skip to content

Commit

Permalink
Merge pull request #201 from 0xneves/better-scripts
Browse files Browse the repository at this point in the history
fix: comment on make transactions and add transaction mined period
  • Loading branch information
0xneves authored Mar 15, 2024
2 parents 5ef5aa3 + 8ef44f4 commit 257d907
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ test-suite-runner:
make cancel

## Feed existing Swaplace contract with some transactions.
## make mint
## Requires a deployed Swaplace contract and mocks.
transactions:
make mint
make approve
Expand Down
3 changes: 3 additions & 0 deletions scripts/createSwap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ export async function main() {
/// @dev Store the recently created swap and it's corresponding ID in the `.env` file.
const swapId = await Swaplace.totalSwaps();
await storeEnv(swapId, "SWAP_ID", tx.hash);

/// @dev Awaits for the transaction to be mined.
await tx.wait();
}

main().catch((error) => {
Expand Down
3 changes: 3 additions & 0 deletions scripts/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ async function main() {

// @dev Store the contract address in the .env file.
await storeEnv(Swaplace.address, "SWAPLACE_ADDRESS", true);

/// @dev Awaits for the transaction to be mined.
await Swaplace.deployed();
}

main().catch((error) => {
Expand Down
6 changes: 5 additions & 1 deletion scripts/deployMock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,13 @@ async function main() {
MockERC721.deployTransaction.hash,
);

// @dev Store the contract addresses in the .env file.
/// @dev Store the contract addresses in the .env file.
await storeEnv(MockERC20.address, "ERC20_ADDRESS", true);
await storeEnv(MockERC721.address, "ERC721_ADDRESS", true);

/// @dev Awaits for the transaction to be mined.
await MockERC20.deployed();
await MockERC721.deployed();
}

main().catch((error) => {
Expand Down
4 changes: 4 additions & 0 deletions scripts/mint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ async function main() {
);

await storeEnv(tokenId, "TOKEN_ID", false);

/// @dev Awaits for the transaction to be mined.
await txErc20.wait();
await txErc721.wait();
}

main().catch((error) => {
Expand Down

0 comments on commit 257d907

Please sign in to comment.