Skip to content

Commit

Permalink
feat: add tests and deploy to testnet
Browse files Browse the repository at this point in the history
  • Loading branch information
0xTimepunk committed Jan 23, 2024
1 parent 1d81e58 commit 57efc39
Show file tree
Hide file tree
Showing 6 changed files with 317 additions and 1 deletion.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
MUMBAI_RPC_URL=
142 changes: 142 additions & 0 deletions broadcast/DeployTestERC1155A.s.sol/80001/deploy-latest.json

Large diffs are not rendered by default.

142 changes: 142 additions & 0 deletions broadcast/DeployTestERC1155A.s.sol/80001/run-1706004511.json

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions script/DeployTestERC1155A.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.23;

import { Script } from "forge-std/Script.sol";

import "forge-std/console.sol";

import "src/test/mocks/MockERC1155A.sol";

contract DeployTestERC1155A is Script {
address public deployedContract;

function deploy() external {
vm.startBroadcast();
MockERC1155A erc1155a = new MockERC1155A("Example", "EXM");
erc1155a.mint(0x48aB8AdF869Ba9902Ad483FB1Ca2eFDAb6eabe92, 1, 100, "" "");
deployedContract = address(erc1155a);
vm.stopBroadcast();
console.log("Deployed contract at: %s", deployedContract);
}
}
6 changes: 6 additions & 0 deletions script/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

# Read the RPC URL
source .env

forge script script/DeployTestERC1155A.s.sol:DeployTestERC1155A --sig "deploy()" --rpc-url $MUMBAI_RPC_URL --broadcast --slow --account defaultKey --sender 0x48aB8AdF869Ba9902Ad483FB1Ca2eFDAb6eabe92
6 changes: 5 additions & 1 deletion src/test/ERC1155.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { MockERC1155A } from "./mocks/MockERC1155A.sol";
* original by @author - solmate
* forked by @author - ZeroPointLabs
*/

contract ERC1155Recipient is ERC1155TokenReceiver {
address public operator;
address public from;
Expand Down Expand Up @@ -151,6 +150,11 @@ contract ERC1155Test is DSTestPlus, ERC1155TokenReceiver {
token = new MockERC1155A("example", "exm");
}

function test_name_symbol() public {
assertEq(token.name(), "example");
assertEq(token.symbol(), "exm");
}

function testMintToEOA() public {
token.mint(address(0xBEEF), 1337, 1, "");

Expand Down

0 comments on commit 57efc39

Please sign in to comment.