Quick Start
Set up Metamask
- Testnet
- Mainnet
Visit Torus Testnet | Chainlist and press "Connect Wallet" or download Metamask here and configure a new network with the following details.
Property | Value |
---|---|
Network name | Torus Horn Testnet |
RPC URL | https://rpc.testnet.toruschain.com/ |
Chain ID | 8194 |
Currency Symbol | tTQF |
Block explorer URL | https://testnet.toruscan.com/ |
Visit Torus Mainnet | Chainlist and press "Connect Wallet" or download Metamask here and configure a new network with the following details.
Property | Value |
---|---|
Network name | Torus Ring Mainnet |
RPC URL | https://rpc.toruschain.com/ |
Chain ID | 8192 |
Currency Symbol | TQF |
Block explorer URL | https://toruscan.com/ |
Deploy Timelock Smart Contract to Testnet
Get testnet funds
There are currently no available faucets. Please request testnet funds from the Torus team.
Write, Deploy and Interact with a contract
Visit Remix IDE and prepare the smart contract.
Create a new Solitidy file in the Remix editor and write your contract. In this example, a timelock contract was implemented.
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.28;
contract Timelock {
address public immutable owner;
uint public immutable unlockTimestamp;
constructor(uint _unlockDays) payable {
owner = msg.sender;
unlockTimestamp = block.timestamp + (_unlockDays * 1 days);
}
function withdraw() public {
require(msg.sender == owner, "not the owner");
require(block.timestamp > unlockTimestamp, "too early");
uint256 contractBalance = address(this).balance;
payable (owner).transfer(contractBalance);
}
}
Navigate to Solidity Compiler pane, make sure your compiler is configured with EVM version set to London under Advanced Configuration and click Compile Timelock.sol.
Navigate to Deploy & run transactions pane, switch Remix to Injected Provider - MetaMask under Environment and switch MetaMask to Torus Testnet. Set the value you would like to send to the constructor, as well as the constructor arguments and click deploy. A MetaMask window will pop up asking you to sign the transaction, you will need to do that in order to deploy your contract. In this example, the constructor receives 10 TQF and is called with the argument 7. This locks 10 TQF for a duration of 7 days.
You can now copy the contract address or interact with the contract using the functions available under "Deployed Contracts". For this example you can read the owner, read the unlock timestamp and trigger the withdraw transaction.