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

feat: Implement mint and burn #106

Open
wants to merge 46 commits into
base: main
Choose a base branch
from

Conversation

victor-yanev
Copy link
Contributor

@victor-yanev victor-yanev commented Nov 4, 2024

Description:

This PR:

  • implements the mintToken and burnToken methods from the HTS interface

Related issue(s):

Fixes #78

Notes for reviewer:

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

@victor-yanev victor-yanev self-assigned this Nov 4, 2024
@victor-yanev victor-yanev requested a review from a team as a code owner November 4, 2024 14:22
@victor-yanev victor-yanev added the feature Enhancing an existing feature driven by business requirements. Typically backwards compatible. label Nov 4, 2024
Signed-off-by: Victor Yanev <[email protected]>
@victor-yanev victor-yanev force-pushed the 78-implement-burn-and-mint-of-HTS-tokens branch from bce3576 to c32669b Compare November 4, 2024 14:49
victor-yanev and others added 15 commits November 5, 2024 12:11
Signed-off-by: Victor Yanev <[email protected]>
Signed-off-by: Victor Yanev <[email protected]>
Signed-off-by: Victor Yanev <[email protected]>

# Conflicts:
#	@hts-forking/out/HtsSystemContract.sol/HtsSystemContract.json
Signed-off-by: Victor Yanev <[email protected]>
Signed-off-by: Victor Yanev <[email protected]>
Signed-off-by: Victor Yanev <[email protected]>
Signed-off-by: Victor Yanev <[email protected]>
Signed-off-by: Victor Yanev <[email protected]>
Signed-off-by: Victor Yanev <[email protected]>
src/HtsSystemContract.sol Outdated Show resolved Hide resolved
src/HtsSystemContract.sol Outdated Show resolved Hide resolved
src/HtsSystemContract.sol Outdated Show resolved Hide resolved
src/IERC20.sol Outdated Show resolved Hide resolved
src/HtsSystemContract.sol Outdated Show resolved Hide resolved
test/HTS.t.sol Outdated Show resolved Hide resolved
Signed-off-by: Victor Yanev <[email protected]>

# Conflicts:
#	test/lib/TestSetup.sol
Signed-off-by: Victor Yanev <[email protected]>
Signed-off-by: Victor Yanev <[email protected]>
…nd-mint-of-HTS-tokens

Signed-off-by: Victor Yanev <[email protected]>

# Conflicts:
#	.gitignore
#	src/HtsSystemContract.sol
#	src/IHederaTokenService.sol
#	test/HTS.t.sol
#	test/lib/MocksToStorageLoader.sol
Signed-off-by: Victor Yanev <[email protected]>
…nd-mint-of-HTS-tokens

Signed-off-by: Victor Yanev <[email protected]>

# Conflicts:
#	src/HtsSystemContract.sol
…nd-mint-of-HTS-tokens

Signed-off-by: Victor Yanev <[email protected]>

# Conflicts:
#	src/HtsSystemContract.sol
Signed-off-by: Victor Yanev <[email protected]>
@victor-yanev victor-yanev marked this pull request as ready for review November 22, 2024 09:14
@victor-yanev victor-yanev requested review from a team as code owners November 22, 2024 09:14
@victor-yanev victor-yanev changed the base branch from main to 108-Implement-getTokenInfo-v2 November 22, 2024 09:15
Base automatically changed from 108-Implement-getTokenInfo-v2 to main November 22, 2024 15:09
src/htsSetup.sol Outdated Show resolved Hide resolved
src/HtsSystemContract.sol Outdated Show resolved Hide resolved
src/HtsSystemContract.sol Outdated Show resolved Hide resolved
src/HtsSystemContractJson.sol Show resolved Hide resolved
test/HTS.t.sol Show resolved Hide resolved
src/HtsSystemContract.sol Outdated Show resolved Hide resolved
src/HtsSystemContract.sol Outdated Show resolved Hide resolved
src/HtsSystemContract.sol Outdated Show resolved Hide resolved
Signed-off-by: Victor Yanev <[email protected]>
…S-tokens' into 78-implement-burn-and-mint-of-HTS-tokens

Signed-off-by: Victor Yanev <[email protected]>
Copy link
Contributor

@acuarica acuarica left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, left one comment, and we good to go. Nice stuff!

address from = address(bytes20(msg.data[40:60]));
address to = address(bytes20(msg.data[72:92]));
uint256 amount = uint256(bytes32(msg.data[92:124]));
_initTokenData();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't need this here. _update can also be called with transfers, where getTokenInfo shouldn't be needed. The main issue by having this here is that we may be triggering unnecessary requests to getTokenInfo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Enhancing an existing feature driven by business requirements. Typically backwards compatible.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Core] Implement minting/burning HTS fungible tokens
2 participants