For all of our deployments, the address is the same between mainnet and testnet. Our source code is verified on Etherscan.
|Contract||Token Address||Controller Address||Mainnet||Rinkeby|
Getting Testnet Tokens
For the testnet tokens, the controller is a TokenFaucet, so anybody can mint as many test tokens as they want.
0x5c3976a8) to the appropriate controller to obtain funds.
Here is an example.
Note that the tokens have 18 decimal places of precision.
You can mint up to 1,000,000,000,000 tokens per transaction.
Registering for Autosweep
This repository contains the smart contracts for TrueUSD and TrueGBP, as well as the contracts that support them. This section contains a high-level overview of the contracts. For specifics, see the relevant .sol files.
DELEGATECALL proxies so that we can upgrade our contracts without changing their addresses.
We always seek a security audit before upgrading, in order to mitigate risk.
All of the tokens use the storage laid out in ProxyStorage.sol. Solidity storage variables for tokens should not be declared in any other file. This mitigates the risk of the storage layout shifting between upgrades.
These contracts are inspired by and roughly equivalent to the corresponding ERC20 token contracts from OpenZeppelin. Work is separated into internal functions that can be overridden for storage migrations.
TokenController is the owner for each of our tokens. Power is separated between the Owner key, Mint Pause Keys, the Mint Key, and Mint Ratifier Keys, which protect the mint process. Risk is configurable in the mint limits.
This contract can be the owner of a TokenController. It turns every TokenController owner function into a multisig function that requires 2/3 approvals.
Our own implementation of Claimable Contract, formerly part of OpenZeppelin.
This limits the minimum and maximum number of tokens that can be redeemed per-transaction.
This file processes attributes synced from the Registry.
Registering a wallet creates a million deposit addresses that automatically forward their True Currency balances. The created deposit addresses share the first 35 characters of their address with the registering wallet. You can register your deposit address using the Autosweep Registrar.
Transfers to any of your deposit addresses will forward to your wallet in the same transaction.
Such transactions will emit two
The first event documents the expected value transfer from the sender to the deposit address.
The second event documents the automatic sweep from the deposit address to the wallet.
Exchanges should register deposit addresses to reduce their operating overhead.
You can redeem these tokens for fiat by transfering them to your redemption address, which starts with at least thirty-five zeroes. Sign up for your redemption address by creating a TrustToken account.
By contacting us, you can register a contract to receive a callback when it receives tokens.
We reduce the amount of gas you pay by refunding gas during your transfer.
TrueUSD.sol, TrueGBP.sol, etc.
These are the top-level ERC20 contracts. They inherit the aforementioned functionality.
Before creating a pull request, please run the tests, the profiler, and the flattener.
Initialize the registry submodule in the root directory.
git submodule init && git submodule update
npm install npm test # runs ./test.sh
To run the profiler and update
GasProfile.json, run the profile script in the root directory.
npm run profile # runs ./profile.sh
Run the flattener in the root directory.
npm run flatten # runs ./flatten-all
|Purchase and Redeem||https://app.trusttoken.com/|
Exchanges where TrueUSD is Traded