Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: silence warnings and fix _transfer in CompliantERC20 #294

Merged
merged 2 commits into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
284 changes: 0 additions & 284 deletions examples/GasEstimation.sol

This file was deleted.

2 changes: 1 addition & 1 deletion examples/Governor/Timelock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ contract Timelock {
delay = delay_;
}

fallback() external payable {}
receive() external payable {}

function setDelay(uint delay_) public {
require(msg.sender == address(this), "Timelock::setDelay: Call must come from Timelock.");
Expand Down
6 changes: 3 additions & 3 deletions examples/Identity/CompliantERC20.sol
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ contract CompliantERC20 is EncryptedERC20 {

// Transfers an encrypted amount.
function _transfer(address from, address to, euint64 _amount, ebool isTransferable) internal override {
// Condition 1: hasEnoughFunds
ebool enoughFund = TFHE.le(_amount, balances[from]);
euint64 amount = TFHE.cmux(enoughFund, _amount, TFHE.asEuint64(0));
// Condition 1: hasEnoughFunds and hasEnoughAllowance (classical ERC20)
euint64 amount = TFHE.cmux(isTransferable, _amount, TFHE.asEuint64(0));

amount = rulesContract.transfer(from, to, amount);

balances[to] = balances[to] + amount;
balances[from] = balances[from] - amount;
emit Transfer(from, to);
}
}
70 changes: 0 additions & 70 deletions test/tfheOperations/gasEstimation.ts

This file was deleted.

Loading