Skip to content

Commit 9f15571

Browse files
committed
feat: added example ERC20 contract
1 parent 569a16b commit 9f15571

File tree

1 file changed

+0
-33
lines changed

1 file changed

+0
-33
lines changed

contracts/examples/DiscreteERC20.sol

-33
Original file line numberDiff line numberDiff line change
@@ -115,39 +115,6 @@ contract DiscreteERC20 {
115115
return true;
116116
}
117117

118-
/// @notice Approves a spender to use a specified amount of the owner's tokens
119-
/// @param spender The address authorized to spend the tokens
120-
/// @param amount The amount of tokens they are authorized to use, represented as encrypted data
121-
/// @return success A boolean value indicating success of the approval
122-
function approve(
123-
address spender,
124-
Ciphertext calldata amount
125-
) external returns (bool success) {
126-
allowance[msg.sender][spender] = amount;
127-
emit Approval(msg.sender, spender, amount);
128-
return true;
129-
}
130-
131-
/// @notice Transfers tokens from one address to another using an allowance
132-
/// @param sender The address from which tokens are transferred
133-
/// @param recipient The address to which tokens are transferred
134-
/// @param amount The amount of tokens to transfer, represented as encrypted data
135-
/// @return success A boolean value indicating success of the transfer
136-
function transferFrom(
137-
address sender,
138-
address recipient,
139-
Ciphertext calldata amount
140-
) external returns (bool success) {
141-
allowance[sender][msg.sender] = this._sub(
142-
allowance[sender][msg.sender],
143-
amount
144-
);
145-
balanceOf[sender] = this._sub(balanceOf[sender], amount);
146-
balanceOf[recipient] = this._add(balanceOf[recipient], amount);
147-
emit Transfer(sender, recipient, amount);
148-
return true;
149-
}
150-
151118
/// @dev Internal function to mint new encrypted tokens
152119
/// @param to The address to receive the newly minted tokens
153120
/// @param amount The amount of tokens to mint, represented as encrypted data

0 commit comments

Comments
 (0)