-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Mariusz Jasuwienas <[email protected]>
- Loading branch information
1 parent
c410d3c
commit f3c41fb
Showing
3 changed files
with
55 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
pragma solidity ^0.8.0; | ||
|
||
import {IHederaTokenService} from "./IHederaTokenService.sol"; | ||
|
||
/// @dev HTS Token Proxy contract defined in HIP-719, Specification section. | ||
/// | ||
/// For more information, | ||
/// see https://github.com/hashgraph/hedera-smart-contracts/issues/885. | ||
contract HRC719TokenProxy { | ||
fallback() external payable { | ||
address tokenAddress = address(this); | ||
assembly { | ||
let precompileAddress := 0x167 | ||
let dynamicData := sload(tokenAddress) | ||
mstore(0, dynamicData) | ||
calldatacopy(32, 0, calldatasize()) | ||
let result := call(gas(), precompileAddress, 0, 0, add(32, calldatasize()), 0, 0) | ||
let size := returndatasize() | ||
returndatacopy(0, 0, size) | ||
switch result | ||
case 0 { revert(0, size) } | ||
default { return(0, size) } | ||
} | ||
} | ||
} |
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 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