-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a88b03a
commit e0cd93f
Showing
14 changed files
with
415 additions
and
632 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 was deleted.
Oops, something went wrong.
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,17 @@ | ||
// SPDX-License-Identifier: BSD-3-Clause-Clear | ||
|
||
pragma solidity ^0.8.24; | ||
|
||
import "fhevm/lib/TFHE.sol"; | ||
import "fhevm/config/ZamaFHEVMConfig.sol"; | ||
import "fhevm-contracts/contracts/token/ERC20/extensions/ConfidentialERC20Mintable.sol"; | ||
|
||
/// @notice This contract implements an encrypted ERC20-like token with confidential balances using Zama's FHE library. | ||
/// @dev It supports typical ERC20 functionality such as transferring tokens, minting, and setting allowances, | ||
/// @dev but uses encrypted data types. | ||
contract MyConfidentialERC20 is SepoliaZamaFHEVMConfig, ConfidentialERC20Mintable { | ||
/// @notice Constructor to initialize the token's name and symbol, and set up the owner | ||
/// @param name_ The name of the token | ||
/// @param symbol_ The symbol of the token | ||
constructor(string memory name_, string memory symbol_) ConfidentialERC20Mintable(name_, symbol_, msg.sender) {} | ||
} |
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,27 @@ | ||
import { DeployFunction } from "hardhat-deploy/types"; | ||
import { HardhatRuntimeEnvironment } from "hardhat/types"; | ||
|
||
const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { | ||
const { deployer } = await hre.getNamedAccounts(); | ||
const { deploy } = hre.deployments; | ||
|
||
// Deploy MyConfidentialERC20 | ||
const deployedERC20 = await deploy("MyConfidentialERC20", { | ||
from: deployer, | ||
args: ["Naraggara", "NARA"], | ||
log: true, | ||
}); | ||
console.log(`MyConfidentialERC20 contract: `, deployedERC20.address); | ||
|
||
// Deploy EncryptedCounter4 | ||
const deployedCounter = await deploy("EncryptedCounter4", { | ||
from: deployer, | ||
args: [], // No constructor arguments needed | ||
log: true, | ||
}); | ||
console.log(`EncryptedCounter4 contract: `, deployedCounter.address); | ||
}; | ||
|
||
export default func; | ||
func.id = "deploy_confidentialERC20"; // id required to prevent reexecution | ||
func.tags = ["MyConfidentialERC20"]; |
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
Oops, something went wrong.