Skip to content

Commit

Permalink
[Goerli] ETStables support v2 (#211)
Browse files Browse the repository at this point in the history
* feat: add TopUpWithLimitsStables factory support; add AllowedTokensRegistry support

* refactor: extract useMotionTokenData to separate file

* fix: top up motion description for motion with custom token set

* refactor: bring back removed motion types as read-only types to not break the archive data

* refactor: rename token check result: check1 -> tokenError
  • Loading branch information
katamarinaki authored Nov 23, 2023
1 parent 41ac7a2 commit 72224f8
Show file tree
Hide file tree
Showing 24 changed files with 1,029 additions and 82 deletions.
259 changes: 259 additions & 0 deletions abi/TopUp/AllowedTokensRegistry.abi.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,259 @@
[
{
"inputs": [
{ "internalType": "address", "name": "_admin", "type": "address" },
{
"internalType": "address[]",
"name": "_addTokenToAllowedListRoleHolders",
"type": "address[]"
},
{
"internalType": "address[]",
"name": "_removeTokenFromAllowedListRoleHolders",
"type": "address[]"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "bytes32",
"name": "role",
"type": "bytes32"
},
{
"indexed": true,
"internalType": "bytes32",
"name": "previousAdminRole",
"type": "bytes32"
},
{
"indexed": true,
"internalType": "bytes32",
"name": "newAdminRole",
"type": "bytes32"
}
],
"name": "RoleAdminChanged",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "bytes32",
"name": "role",
"type": "bytes32"
},
{
"indexed": true,
"internalType": "address",
"name": "account",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "sender",
"type": "address"
}
],
"name": "RoleGranted",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "bytes32",
"name": "role",
"type": "bytes32"
},
{
"indexed": true,
"internalType": "address",
"name": "account",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "sender",
"type": "address"
}
],
"name": "RoleRevoked",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "_token",
"type": "address"
}
],
"name": "TokenAdded",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "_token",
"type": "address"
}
],
"name": "TokenRemoved",
"type": "event"
},
{
"inputs": [],
"name": "ADD_TOKEN_TO_ALLOWED_LIST_ROLE",
"outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "DEFAULT_ADMIN_ROLE",
"outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "REMOVE_TOKEN_FROM_ALLOWED_LIST_ROLE",
"outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{ "internalType": "address", "name": "_token", "type": "address" }
],
"name": "addToken",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
"name": "allowedTokens",
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "decimals",
"outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [],
"name": "getAllowedTokens",
"outputs": [
{ "internalType": "address[]", "name": "", "type": "address[]" }
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{ "internalType": "bytes32", "name": "role", "type": "bytes32" }
],
"name": "getRoleAdmin",
"outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{ "internalType": "bytes32", "name": "role", "type": "bytes32" },
{ "internalType": "address", "name": "account", "type": "address" }
],
"name": "grantRole",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{ "internalType": "bytes32", "name": "role", "type": "bytes32" },
{ "internalType": "address", "name": "account", "type": "address" }
],
"name": "hasRole",
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{ "internalType": "address", "name": "_token", "type": "address" }
],
"name": "isTokenAllowed",
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{ "internalType": "uint256", "name": "_tokenAmount", "type": "uint256" },
{ "internalType": "address", "name": "_token", "type": "address" }
],
"name": "normalizeAmount",
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{ "internalType": "address", "name": "_token", "type": "address" }
],
"name": "removeToken",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{ "internalType": "bytes32", "name": "role", "type": "bytes32" },
{ "internalType": "address", "name": "account", "type": "address" }
],
"name": "renounceRole",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{ "internalType": "bytes32", "name": "role", "type": "bytes32" },
{ "internalType": "address", "name": "account", "type": "address" }
],
"name": "revokeRole",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{ "internalType": "bytes4", "name": "interfaceId", "type": "bytes4" }
],
"name": "supportsInterface",
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
"stateMutability": "view",
"type": "function"
}
]
103 changes: 103 additions & 0 deletions abi/TopUp/TopUpWithLimitsStables.abi.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
[
{
"inputs": [
{
"internalType": "address",
"name": "_trustedCaller",
"type": "address"
},
{
"internalType": "address",
"name": "_allowedRecipientsRegistry",
"type": "address"
},
{
"internalType": "address",
"name": "_allowedTokensRegistry",
"type": "address"
},
{ "internalType": "address", "name": "_finance", "type": "address" },
{ "internalType": "address", "name": "_easyTrack", "type": "address" }
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [],
"name": "allowedRecipientsRegistry",
"outputs": [
{
"internalType": "contract IAllowedRecipientsRegistry",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "allowedTokensRegistry",
"outputs": [
{
"internalType": "contract IAllowedTokensRegistry",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{ "internalType": "address", "name": "_creator", "type": "address" },
{ "internalType": "bytes", "name": "_evmScriptCallData", "type": "bytes" }
],
"name": "createEVMScript",
"outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{ "internalType": "bytes", "name": "_evmScriptCallData", "type": "bytes" }
],
"name": "decodeEVMScriptCallData",
"outputs": [
{ "internalType": "address", "name": "token", "type": "address" },
{
"internalType": "address[]",
"name": "recipients",
"type": "address[]"
},
{ "internalType": "uint256[]", "name": "amounts", "type": "uint256[]" }
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [],
"name": "easyTrack",
"outputs": [
{ "internalType": "contract IEasyTrack", "name": "", "type": "address" }
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "finance",
"outputs": [
{ "internalType": "contract IFinance", "name": "", "type": "address" }
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "trustedCaller",
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
"stateMutability": "view",
"type": "function"
}
]
1 change: 1 addition & 0 deletions modules/blockChain/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const DEFAULT_DECIMALS = 18
10 changes: 7 additions & 3 deletions modules/blockChain/contractAddresses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,17 @@ export const LegoDAIRegistry: ChainAddressMap = {
[CHAINS.Goerli]: '0x5884f5849414D4317d175fEc144e2F87f699B082',
}

export const RccDAIRegistry: ChainAddressMap = {
export const RccStablesRegistry: ChainAddressMap = {
[CHAINS.Mainnet]: '0xDc1A0C7849150f466F07d48b38eAA6cE99079f80',
[CHAINS.Goerli]: '0x1440E8aDbE3a42a9EDB4b30059df8F6c35205a15',
}

export const PmlDAIRegistry: ChainAddressMap = {
export const PmlStablesRegistry: ChainAddressMap = {
[CHAINS.Mainnet]: '0xDFfCD3BF14796a62a804c1B16F877Cf7120379dB',
[CHAINS.Goerli]: '0xAadfBd1ADE92d85c967f4aE096141F0F802F46Db',
}

export const AtcDAIRegistry: ChainAddressMap = {
export const AtcStablesRegistry: ChainAddressMap = {
[CHAINS.Mainnet]: '0xe07305F43B11F230EaA951002F6a55a16419B707',
[CHAINS.Goerli]: '0xedD3B813275e1A88c2283FAfa5bf5396938ef59e',
}
Expand Down Expand Up @@ -123,3 +123,7 @@ export const SDVTRegistry: ChainAddressMap = {
[CHAINS.Goerli]: '0x6370FA71b9Fd83aFC4196ee189a0d348C90E93b0',
[CHAINS.Holesky]: '0x11a93807078f8BB880c1BD0ee4C387537de4b4b6',
}

export const AllowedTokensRegistry: ChainAddressMap = {
[CHAINS.Goerli]: '0xeda5a9F02a580B4A879aEA65E2a7B7fEc0956b0E',
}
Loading

0 comments on commit 72224f8

Please sign in to comment.