Skip to content

Commit

Permalink
(fix) config updates.
Browse files Browse the repository at this point in the history
(feat) Configure bsc zilbridge routing
(feat) Start of explicit workflow
  • Loading branch information
rrw-zilliqa committed Jan 13, 2025
1 parent dfd993a commit 1aef6f8
Show file tree
Hide file tree
Showing 19 changed files with 1,333 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/workflows/cicd-prd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
push:
branches:
- main
workflow-dispatch:
# On released
release:
types: [published]
Expand Down
18 changes: 13 additions & 5 deletions bridge-web/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function getAvailableTokens(fromChainConfig: ChainConfig, toChainConfig: ChainCo
const avail = Array.from(fromChainConfig.tokens).filter((tok) =>
tok.bridgesTo.find((network) => network == toChainConfig.chain))
.sort((a,b) => a.name.localeCompare(b.name, 'en') );
let names = avail.map((x) => (x.name));
//let names = avail.map((x) => (x.name));
return avail;

}
Expand Down Expand Up @@ -102,17 +102,23 @@ function App() {
if (!newFromChain?.chain) {
return;
}
console.log(`set[0] ${goFrom} ${goTo} ${newFromChain.chain}`);
if (newFromChain.chain != siteConfig.homeNetwork) {
goTo = siteConfig.homeNetwork;
} else {
if (goTo == siteConfig.homeNetwork) {
let firstNetwork = Object.values(chainConfigs).find((config) => config.chain !== siteConfig.homeNetwork);
goTo = firstNetwork!.chain;
if (goFrom != siteConfig.homeNetwork) {
goTo = goFrom;
} else {
let firstNetwork = Object.values(chainConfigs).find((config) => config.chain !== siteConfig.homeNetwork);
goTo = firstNetwork!.chain;
}
}
}
goFrom = newFromChain?.chain;
}
if (toChainConfig.chain != goTo || fromChainConfig.chain != goFrom) {
console.log(`set[1] ${JSON.stringify(currentChains)}`);
setCurrentChains([goFrom, goTo]);
}
}, [chain,pendingToChainConfig]);
Expand All @@ -121,6 +127,7 @@ function App() {
// Fires when currentChains is set - chooses a token.
useEffect(() => {
const availableTokens = getAvailableTokens(fromChainConfig, toChainConfig);
console.log(`current ${JSON.stringify(currentChains)} avail ${JSON.stringify(availableTokens)}`);
const newToken = availableTokens.find((tok) => tok.name == token.name);
if (newToken === undefined) {
selectedToken(availableTokens[0])
Expand Down Expand Up @@ -596,12 +603,13 @@ function App() {
// - set the from chain to the home network.
let nextFromChain = fromChainConfig.chain;
if (chain === siteConfig.homeNetwork) {
if (fromChainConfig.chain === chain) {
if (toChainConfig.chain === siteConfig.homeNetwork) {
// Set the fromChain to the first non-home network, if there is one.
let firstNetwork = Object.values(chainConfigs).find((config) => config.chain !== siteConfig.homeNetwork)
nextFromChain = firstNetwork!.chain;
} else {
// Ignore.
// Flip from and to chains.
nextFromChain = toChainConfig.chain;
}
} else {
nextFromChain = siteConfig.homeNetwork;
Expand Down
27 changes: 27 additions & 0 deletions bridge-web/src/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,15 @@ export const chainConfigs: Partial<Record<Chains, ChainConfig>> =
tokenManagerType: TokenManagerType.LockAndRelease,
bridgesTo: [ "ethereum" ]
},
{
name: "BNB",
address: "0xea87bC6CcaE73bae35693639e22eF30667760F61",
blockExplorer: "https://otterscan.zilliqa.com/address/0xea87bC6CcaE73bae35693639e22eF30667760F16",
logo: seed_token,
tokenManagerAddress: "0x4fa6148C9DAbC7A737422fb1b3AB9088c878d26C",
tokenManagerType: TokenManagerType.LockAndRelease,
bridgesTo: [ "bsc" ]
},
],
chainId: 32769,
isZilliqa: true,
Expand Down Expand Up @@ -430,6 +439,24 @@ export const chainConfigs: Partial<Record<Chains, ChainConfig>> =
tokenManagerType: TokenManagerType.MintAndBurn,
bridgesTo: [ "zq" ]
},
{
name: "BNB",
address: null,
blockExplorer: "https://bscscan.com/address/0x0000000000000000000000000000000000000000",
logo: seed_token,
tokenManagerAddress: "0x1202078D298Ff0358A95b6fbf48Ec166dB414660",
tokenManagerType: TokenManagerType.LockAndRelease,
bridgesTo: [ "zq" ]
},
{
name: "ZIL",
address: "0xb1E6F8820826491FCc5519f84fF4E2bdBb6e3Cad",
blockExplorer: "https://otterscan.zilliqa.com/address/0xb1E6F8820826491FCc5519f84fF4E2bdBb6e3Cad",
logo: seed_token,
tokenManagerAddress: "0x2EE8e8D7C113Bb7c180f4755f06ed50bE53BEDe5",
tokenManagerType: TokenManagerType.ZilBridge,
bridgesTo: ["zq"]
}
],
chainId: 56,
isZilliqa: false,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"transactions": [
{
"hash": null,
"transactionType": "CREATE",
"contractName": "LockProxyTokenManagerUpgradeableV4",
"contractAddress": "0x3fac7cb5b45a3b59d76b6926bc704cf3cc522437",
"function": null,
"arguments": null,
"transaction": {
"from": "0xd89421cd5dd6d6269fbb9307535c386afe11a23e",
"gas": "0x1de79e",
"value": "0x0",
"input": "0x60a06040523461003c5730608052610015610041565b61001d610041565b6040516119d290816100df823960805181818161077901526108580152f35b600080fd5b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805460ff8160401c166100cc576001600160401b036002600160401b03198282160161008d57505050565b6001600160401b031990911681179091556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d290602090a1565b60405163f92ee8a960e01b8152600490fdfe60406080815260048036101561001457600080fd5b600091823560e01c918263126d5f2f1461123a57826313baf1e6146111a157838363164e68de1461111e575082631a90748a14610dfa578263335a940614610b585782633b534ad814610b3d5782633d18678e14610aca5782633f4ba83a14610a5157826342bf3cc114610a1b5782634f1ef286146107dd57826352d1902d146107645782635c975abb1461073357826366c81418146106de578263715018a61461065d578263766a1b7b1461059157826379ba5097146104ee5782638456cb59146104865782638bc76f741461044f5782638da5cb5b1461041957826390646b4a146103c8578263a97044a014610380578263ad3cb1cc1461031157508163b89e311e14610286578163bdda65b714610250578163db8d55f114610212578163e30c3978146101d8575063f2fde38b1461014e57600080fd5b346101d55760203660031901126101d5576101676112f9565b61016f611835565b60008051602061195d83398151915280546001600160a01b0319166001600160a01b039283169081179091556000805160206118fd833981519152549091167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e227008380a380f35b80fd5b90503461020e578160031936011261020e5760008051602061195d8339815191525490516001600160a01b039091168152602090f35b5080fd5b90503461020e578160031936011261020e576020907f160d773a327af1b4c116f10b1dde265dd32ef2539dc09d78f0d75883ba9f9a00549051908152f35b90503461020e578160031936011261020e5760008051602061191d8339815191525490516001600160a01b039091168152602090f35b90503461020e578060031936011261020e5760809161030a6102e36102a96112f9565b926024356102b5611423565b506102bf8561147b565b8183526020526102d186832095611442565b90825260205284812054900b926114b4565b925180936040809160018060a01b0380825116855260208201511660208501520151910152565b6060820152f35b83823461020e578160031936011261020e578051918183019083821067ffffffffffffffff83111761036d57506103699350815260058252640352e302e360dc1b6020830152519182916020835260208301906113e3565b0390f35b634e487b7160e01b815260418552602490fd5b83823461020e578160031936011261020e577fb22af1dfa3d79e3af56bf3b03e8c9cb6d48fc6bbb7ec48dcbfc0dbccf342f8005490516001600160a01b039091168152602090f35b83346101d55760203660031901126101d5576103e26112f9565b6103ea611835565b60008051602061197d83398151915280546001600160a01b0319166001600160a01b0390921691909117905580f35b83823461020e578160031936011261020e576000805160206118fd8339815191525490516001600160a01b039091168152602090f35b83346101d55760803660031901126101d55761048361046c6112f9565b6104753661137c565b9061047e611835565b611511565b80f35b83823461020e578160031936011261020e5760207f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258916104c4611835565b6104cc61186e565b60008051602061193d833981519152805460ff1916600117905551338152a180f35b91503461058d578260031936011261058d5760008051602061195d8339815191528054926001600160a01b039233848616036105765750506001600160a01b031992831690556000805160206118fd8339815191528054339381168417909155167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b60249250519063118cdaa760e01b82523390820152fd5b8280fd5b83823461020e578060031936011261020e576105ab6112f9565b906001600160a01b036024358181169290839003610659576105cb611835565b60008051602061191d8339815191528054927f90ca77ab15009de2392c35890c8e7fb753565ab9e96a342289aa32fcf433f35a60807fb22af1dfa3d79e3af56bf3b03e8c9cb6d48fc6bbb7ec48dcbfc0dbccf342f8009788549584815192818a1684521694856020840152871690820152876060820152a16001600160a01b03199384161790551617905580f35b8480fd5b83346101d557806003193601126101d557610676611835565b60008051602061195d83398151915280546001600160a01b03199081169091556000805160206118fd8339815191528054918216905581906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b83823461020e578060031936011261020e5760609061073161070a6107016112f9565b602435906114e8565b915180926040809160018060a01b0380825116855260208201511660208501520151910152565bf35b83823461020e578160031936011261020e5760209060ff60008051602061193d833981519152541690519015158152f35b9083346101d557806003193601126101d557507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031630036107d057602090517f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8152f35b5163703e46dd60e11b8152fd5b91508060031936011261058d576107f26112f9565b90602493843567ffffffffffffffff811161020e573660238201121561020e578085013593610820856113c7565b61082c8551918261135a565b85815260209586820193368a83830101116109d2578186928b8a93018737830101526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081163081149081156109ed575b506109dd57610891611835565b85516352d1902d60e01b81529083169680828a818b5afa91829187936109a9575b50506108ce5750505050505191634c9c8ce360e01b8352820152fd5b86899689927f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc908181036109945750853b1561097f5780546001600160a01b0319168317905551869392917fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b8580a282511561096357505061095f9382915190845af46109596115ec565b91611899565b5080f35b9350935050503461097357505080f35b63b398979f60e01b8152fd5b5051634c9c8ce360e01b815291820152859150fd5b848a91845191632a87526960e21b8352820152fd5b9080929350813d83116109d6575b6109c1818361135a565b810103126109d257519038806108b2565b8580fd5b503d6109b7565b855163703e46dd60e11b81528890fd5b9050817f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5416141538610884565b83823461020e578160031936011261020e5760008051602061197d8339815191525490516001600160a01b039091168152602090f35b9091503461058d578260031936011261058d57610a6c611835565b60008051602061193d8339815191529081549060ff821615610abc575060ff19169055513381527f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa90602090a180f35b8351638dfc202b60e01b8152fd5b9091503461058d57602036600319011261058d573590610ae8611835565b7f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a17f160d773a327af1b4c116f10b1dde265dd32ef2539dc09d78f0d75883ba9f9a009182548151908152846020820152a15580f35b83823461020e578160031936011261020e5751908152602090f35b909150608036600319011261058d57610b6f6112f9565b602435926001600160a01b03604435818116949390859003610df65760643595610b9761186e565b7f160d773a327af1b4c116f10b1dde265dd32ef2539dc09d78f0d75883ba9f9a0054803410610dd85750610bcb81836114e8565b91602097888401928584511615610dc857610be583611442565b908b528952858a20548a0b8a811215610d9457607f198114610d8157610c0e908b038b0b61177d565b91610c23610c1c8484611815565b9384611802565b808303610d60575090610c37913390611634565b8360008051602061197d833981519152541693808685015193511693511696855197610c6289611328565b88528888015284870152610c99845196888801906040809160018060a01b0380825116855260208201511660208501520151910152565b60608652608086019486861067ffffffffffffffff871117610d4d575084845263034f42cf60e61b8552608486015260a4850152630d483a4560e11b60c485015260a060e4850152849083908188610cf56101248901896113e3565b620f42406101048a0152889003607f1901925af1908115610d445750610d19578380f35b82903d8411610d3c575b81610d2d9161135a565b810103126101d5573880808380f35b3d9150610d23565b513d86823e3d90fd5b634e487b7160e01b895260419052602488fd5b8860649185858b519362cf329160e31b855284015260248301526044820152fd5b634e487b7160e01b8b526011885260248bfd5b8a811315610dbf57610da59061177d565b91610dba610db38484611802565b9384611815565b610c23565b50809181610c23565b86516317cbb6ef60e11b81528890fd5b84516311e9ebaf60e31b815234818801526024810191909152604490fd5b8680fd5b9091503461058d5736600319016060811261111a57821361058d576044359067ffffffffffffffff80831161065957366023840112156106595782820135908111610659578201923660248501116106595760008051602061197d833981519152546001600160a01b0394908516330361110c5783606091031261065957805191610e8483611328565b610e9060248501611314565b91828452610ea060448601611314565b9386610ec3602095868401978852606485850199013589528535928391166114e8565b908582019189835116156110fc57840151036110ed57602435908882168092036110e957518816036110db578680915116945116945191867fb22af1dfa3d79e3af56bf3b03e8c9cb6d48fc6bbb7ec48dcbfc0dbccf342f80054169660008051602061191d83398151915254168515600014610fd3575085606485928a85519a8b948593630432023b60e11b85528401528160248401528760448401525af1958615610fc9577fe663194c61ff0a40458d7576da15093f6ef6a4167ebfe6b632c1d2b1a071acf0949596610f9c575b505b51908152a380f35b610fbb90843d8611610fc2575b610fb3818361135a565b81019061161c565b5038610f92565b503d610fa9565b81513d89823e3d90fd5b8251630432023b60e11b8152308382019081526001600160a01b038816602082015260408101869052939891939091869183919082908d90829060600103925af180156110d157918798939186936110b4575b5083516323b872dd60e01b81526001600160a01b03928316918101918252989091166020820152604081018490528790819060600103818a885af1958615610fc9577fe663194c61ff0a40458d7576da15093f6ef6a4167ebfe6b632c1d2b1a071acf0949596611097575b50610f94565b6110ad90843d8611610fc257610fb3818361135a565b5038611091565b6110ca90843d8611610fc257610fb3818361135a565b5038611026565b88513d8b823e3d90fd5b5051630f38bf5560e31b8152fd5b8980fd5b505051633b9eff1960e11b8152fd5b84516317cbb6ef60e11b81528690fd5b505163e7e601db60e01b8152fd5b8380fd5b9192503461020e57602036600319011261020e57356001600160a01b0381169081900361020e5781808092611151611835565b47907f9800e6f57aeb4360eaa72295a820a4293e1e66fbfcabcd8874ae141304a76deb60208851848152a1828215611198575bf11561118e575080f35b51903d90823e3d90fd5b506108fc611184565b83823461020e578060031936011261020e577fbe9bb4bdca0a094babd75e3a98b1d2e2390633430d0a2f6e2b9970e2ee03fb2e906111dd6112f9565b6024356111e8611835565b6111f18261147b565b818652602052846002848220828155826001820155015561121182611442565b8186526020908152838620805460ff1916905583516001600160a01b039093168352820152a180f35b83823461020e5760a036600319011261020e576112556112f9565b61125e3661137c565b916084359081850b928383036109d2577fa133e3c36769b3c9a2109eba45aba2da2ad0ccab8c9c6cc6c244892ba14d0f709360809361129b611835565b6112a58784611511565b6112ae83611442565b908488019182518a526020528489209060ff198254169060ff1617905560018060a01b0393846020818a5116990151169151918151988952602089015287015260608601521692a280f35b600435906001600160a01b038216820361130f57565b600080fd5b35906001600160a01b038216820361130f57565b6060810190811067ffffffffffffffff82111761134457604052565b634e487b7160e01b600052604160045260246000fd5b90601f8019910116810190811067ffffffffffffffff82111761134457604052565b606090602319011261130f576040519061139582611328565b816001600160a01b03602435818116810361130f578252604435908116810361130f5760208201526040606435910152565b67ffffffffffffffff811161134457601f01601f191660200190565b919082519283825260005b84811061140f575050826000602080949584010152601f8019910116010190565b6020818301810151848301820152016113ee565b6040519061143082611328565b60006040838281528260208201520152565b6001600160a01b031660009081527f4a6c2e6a7e6518c249bdcd1d934ea16ea5325bbae105af814eb678f5f49f34026020526040902090565b6001600160a01b031660009081527f4a6c2e6a7e6518c249bdcd1d934ea16ea5325bbae105af814eb678f5f49f34016020526040902090565b906040516114c181611328565b82546001600160a01b03908116825260018401541660208201526002909201546040830152565b6114fa906114f4611423565b5061147b565b9060005260205261150e60406000206114b4565b90565b907facee94c8a79111860852775471f35a102ad3dc32ff2716802bd1000ceb51f5a89061153d8361147b565b92604082019384516000526020526115e760406000209460018060a01b0380858180975116986bffffffffffffffffffffffff60a01b998a82541617815560018101602083019a848c5116908254161790556002855191015561159f86611442565b8451600052602052604060002060ff198154169055511696511690519060405194859416968460409194939294606082019560018060a01b0380921683521660208201520152565b0390a2565b3d15611617573d906115fd826113c7565b9161160b604051938461135a565b82523d6000602084013e565b606090565b9081602091031261130f5751801515810361130f5790565b60008051602061191d833981519152546001600160a01b039081169392918116919082156116fe576040516323b872dd60e01b81526001600160a01b03838116600483015295909516602486015260448501849052929391926020836064816000885af19182156116f2577f26b76a94c1aa45c85671b8e913c907c573ce5e0eec8760e59bd36b954f190616936020936116d5575b506040519586521693a3565b6116eb90843d8111610fc257610fb3818361135a565b50386116c9565b6040513d6000823e3d90fd5b6020906000808080887f26b76a94c1aa45c85671b8e913c907c573ce5e0eec8760e59bd36b954f190616979a5af1956117356115ec565b506040519586521693a31561174657565b60405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b6044820152606490fd5b80156117fc57600190602081108216604e82108316176117f4578190600a925b8082116117cb575050816000190481116117b5570290565b634e487b7160e01b600052601160045260246000fd5b9092806000190481116117b5578184166117eb575b800292811c9061179d565b809202916117e0565b9050600a0a90565b50600190565b818102929181159184041417156117b557565b811561181f570490565b634e487b7160e01b600052601260045260246000fd5b6000805160206118fd833981519152546001600160a01b0316330361185657565b60405163118cdaa760e01b8152336004820152602490fd5b60ff60008051602061193d833981519152541661188757565b60405163d93c066560e01b8152600490fd5b906118c057508051156118ae57805190602001fd5b604051630a12f52160e11b8152600490fd5b815115806118f3575b6118d1575090565b604051639996b31560e01b81526001600160a01b039091166004820152602490fd5b50803b156118c956fe9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300b22af1dfa3d79e3af56bf3b03e8c9cb6d48fc6bbb7ec48dcbfc0dbccf342f801cd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f03300237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c004a6c2e6a7e6518c249bdcd1d934ea16ea5325bbae105af814eb678f5f49f3400a2646970667358221220957f96cd9f9bfa9af600a0a69c232c181ae8d0b473ded8f025a6d7ec56eaef0d64736f6c63430008140033",
"nonce": "0x10",
"chainId": "0x38"
},
"additionalContracts": [],
"isFixedGasLimit": false
},
{
"hash": null,
"transactionType": "CALL",
"contractName": null,
"contractAddress": "0x2ee8e8d7c113bb7c180f4755f06ed50be53bede5",
"function": "upgradeToAndCall(address,bytes)",
"arguments": [
"0x3faC7cb5b45A3B59d76b6926bc704Cf3cc522437",
"0x"
],
"transaction": {
"from": "0xd89421cd5dd6d6269fbb9307535c386afe11a23e",
"to": "0x2ee8e8d7c113bb7c180f4755f06ed50be53bede5",
"gas": "0xd57e",
"value": "0x0",
"input": "0x4f1ef2860000000000000000000000003fac7cb5b45a3b59d76b6926bc704cf3cc52243700000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000",
"nonce": "0x11",
"chainId": "0x38"
},
"additionalContracts": [],
"isFixedGasLimit": false
}
],
"receipts": [],
"libraries": [],
"pending": [],
"returns": {},
"timestamp": 1736778684,
"chain": 56,
"commit": "dfd993a"
}
Loading

0 comments on commit 1aef6f8

Please sign in to comment.