Skip to content

Commit

Permalink
Merge pull request #11 from PraneshASP/feat/deploy-script
Browse files Browse the repository at this point in the history
 🚀 Deployment script
  • Loading branch information
PraneshASP authored Aug 11, 2022
2 parents a47b133 + 83e95fb commit b0f409a
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
PRIVATE_KEY=
INFURA_URL=
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,19 @@ forge build
forge test
```

4. Deployment

Create a `.env` file and copy the contents of `.env.examples` to it.
Update the fields with relanvant values.

To proceed with the deployment, run the following command...

```shell
source .env

forge script scripts/Deploy.s.sol:Deploy --fork-url $INFURA_URL --private-key $PRIVATE_KEY --broadcast
```

For more information on how to use Foundry, check out the [Foundry Github Repository](https://github.com/foundry-rs/foundry/tree/master/forge) and the [foundry-huff library repository](https://github.com/huff-language/foundry-huff).

## Blueprint
Expand Down Expand Up @@ -87,7 +100,7 @@ test

## TODO

- [ ] Deploy script
- [x] Deploy script
- [x] Implement `supportsInterface()`
- [ ] Fix token_uri storage
- [ ] Integrate ENS
Expand Down
34 changes: 34 additions & 0 deletions scripts/Deploy.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.15;

import "foundry-huff/HuffDeployer.sol";
import "forge-std/Script.sol";

import {Huffbound} from "../src/interfaces/IHuffbound.sol";

contract Deploy is Script {
string nameString = "Huffbound";
string symbolString = "HBTKN";
// Sample URI
string uriString =
"ipfs://QmPMc4tcBsMqLRuCQtPmPe84bpSjrC3Ky7t3JWuHXYB4aS/0";

function run() public returns (Huffbound huffbound) {
bytes memory name = bytes(nameString);
bytes memory symbol = bytes(symbolString);
bytes memory uri = bytes(uriString);

bytes memory args = bytes.concat(
bytes32(name),
bytes32(symbol),
bytes32(uri),
abi.encode(address(this))
);
//vm.startBroadcast();
huffbound = Huffbound(
HuffDeployer.broadcast_with_args("Soulbound", args)
);
//vm.stopBroadcast();
console2.log("Huffbound contract deployed to: ", address(huffbound));
}
}

0 comments on commit b0f409a

Please sign in to comment.