-
-
Notifications
You must be signed in to change notification settings - Fork 41
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
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
...teroperability/bridge-contracts/kosasih-universalis/contracts/KosasihUniversalisNexus.sol
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 @@ | ||
pragma solidity ^0.8.0; | ||
|
||
import "https://github.com/OpenZeppelin/openzeppelin-solidity/contracts/token/ERC20/SafeERC20.sol"; | ||
import "https://github.com/OpenZeppelin/openzeppelin-solidity/contracts/utils/Address.sol"; | ||
|
||
contract KosasihUniversalisNexus { | ||
address public smartContractRegistry; | ||
address public tokenManager; | ||
|
||
constructor(address _smartContractRegistry, address _tokenManager) public { | ||
smartContractRegistry = _smartContractRegistry; | ||
tokenManager = _tokenManager; | ||
} | ||
|
||
function executeTransaction(bytes _transactionData) public { | ||
// Decode the transaction data | ||
(address _contractAddress, bytes _contractData) = abi.decode(_transactionData, (address, bytes)); | ||
|
||
// Call the smart contract registry to get the contract ABI | ||
SmartContractRegistry(smartContractRegistry).getContractABI(_contractAddress); | ||
|
||
// Call the contract with the decoded data | ||
(bool success, ) = _contractAddress.call(_contractData); | ||
require(success, "Transaction execution failed"); | ||
} | ||
} |