Skip to content

Commit

Permalink
Fix the name of wrapped token
Browse files Browse the repository at this point in the history
  • Loading branch information
Lbqds committed Oct 19, 2023
1 parent 09fc636 commit 7242e05
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 24 deletions.
8 changes: 4 additions & 4 deletions alephium/artifacts/token_bridge/RemoteTokenPool.ral.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"version": "v2.5.6",
"name": "RemoteTokenPool",
"bytecode": "090b09402040294032408040d841274143415f417f41a4010000000102a00102010000000104a002140b2028576f726d686f6c65294402010000000102ce0302010000000102a000020101070a004025b31600160116021603160500061708170716061604464c041606160413c3038d7ea4c68000a7b11709160416091607ab16080c334c04160616091608aba00016072a16082aa100000005090240321600ce004113157b160443102f13117b1602ce03000717051603ce0300071706160616053113167b14010116056b44ce0244ce016744160143674416014416066b4417071605ce030008170816071608020000060a02402ace0014010116016744cc1706160616004113157b1603ce024113197b1604ce012f13197b1602ce03000817071605ce0300081708160716083313167b160716082b1709160916080201000202010e16011308334c081600130a160113082b832d0216000201000202010e16011308334c081600130a160113082b832c02160002010003030010b3ce004113157ba0031602310f7b1600a1011601a1021602a103010105070112b316011602160316040005170617051600b11606aca00016062ba100160502",
"codeHash": "9f9a0a641df62cf6d831fbd7e8cdbcc7511682dd9ebf9d988ce42ae7280c6ee9",
"bytecode": "090b094022402b4034408240da412941454161418141a6010000000102a00102010000000104a002140d2028416c7068427269646765294402010000000102ce0302010000000102a000020101070a004025b31600160116021603160500061708170716061604464c041606160413c3038d7ea4c68000a7b11709160416091607ab16080c334c04160616091608aba00016072a16082aa100000005090240321600ce004113157b160443102f13117b1602ce03000717051603ce0300071706160616053113167b14010116056b44ce0244ce016744160143674416014416066b4417071605ce030008170816071608020000060a02402ace0014010116016744cc1706160616004113157b1603ce024113197b1604ce012f13197b1602ce03000817071605ce0300081708160716083313167b160716082b1709160916080201000202010e16011308334c081600130a160113082b832d0216000201000202010e16011308334c081600130a160113082b832c02160002010003030010b3ce004113157ba0031602310f7b1600a1011601a1021602a103010105070112b316011602160316040005170617051600b11606aca00016062ba100160502",
"codeHash": "1887a5c2bc109b742c33e7c8aaa448d600e258cec66dbd7ff188b17fca3da2fd",
"fieldsSig": {
"names": [
"tokenBridge",
Expand Down Expand Up @@ -284,10 +284,10 @@
],
"constants": [
{
"name": "WormholePostfix",
"name": "AlphBridgePostfix",
"value": {
"type": "ByteVec",
"value": "2028576f726d686f6c6529"
"value": "2028416c706842726964676529"
}
}
],
Expand Down
4 changes: 2 additions & 2 deletions alephium/artifacts/ts/RemoteTokenPool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class Factory extends ContractFactory<
RemoteTokenPoolTypes.Fields
> {
consts = {
WormholePostfix: "2028576f726d686f6c6529",
AlphBridgePostfix: "2028416c706842726964676529",
Path: {
AttestTokenHandler: "00",
TokenBridgeForChain: "01",
Expand Down Expand Up @@ -269,7 +269,7 @@ export const RemoteTokenPool = new Factory(
Contract.fromJson(
RemoteTokenPoolContractJson,
"",
"9f9a0a641df62cf6d831fbd7e8cdbcc7511682dd9ebf9d988ce42ae7280c6ee9"
"1887a5c2bc109b742c33e7c8aaa448d600e258cec66dbd7ff188b17fca3da2fd"
)
);

Expand Down
4 changes: 2 additions & 2 deletions alephium/contracts/token_bridge/remote_token_pool.ral
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ Contract RemoteTokenPool(
decimals_: U256,
mut sequence_: U256
) extends BridgeTokenPool(tokenBridge, tokenChainId, bridgeTokenId, totalBridged, decimals_) {
const WormholePostfix = #2028576f726d686f6c6529 // ' (Wormhole)'
const AlphBridgePostfix = #2028416c706842726964676529 // ' (AlphBridge)'

pub fn getSymbol() -> ByteVec {
return symbol_
}

pub fn getName() -> ByteVec {
return name_ ++ WormholePostfix
return name_ ++ AlphBridgePostfix
}

pub fn getDecimals() -> U256 {
Expand Down
2 changes: 1 addition & 1 deletion ethereum/contracts/bridge/mock/MockFeeToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ contract FeeToken is TokenState, Context {
}

function name() public view returns (string memory) {
return string(abi.encodePacked(_state.name, " (Wormhole)"));
return string(abi.encodePacked(_state.name, " (AlphBridge)"));
}

function symbol() public view returns (string memory) {
Expand Down
2 changes: 1 addition & 1 deletion ethereum/contracts/bridge/token/TokenImplementation.sol
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ contract TokenImplementation is TokenState, Context {
}

function name() public view returns (string memory) {
return string(abi.encodePacked(_state.name, " (Wormhole)"));
return string(abi.encodePacked(_state.name, " (AlphBridge)"));
}

function symbol() public view returns (string memory) {
Expand Down
8 changes: 4 additions & 4 deletions ethereum/test/bridge.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,8 @@ contract("Bridge", function () {
// symbol (TT)
assert.equal(log.payload.substr(74, 64), "5454000000000000000000000000000000000000000000000000000000000000")

// name (TestToken (Wormhole))
assert.equal(log.payload.substr(138, 64), "54657374546f6b656e2028576f726d686f6c6529000000000000000000000000")
// name (TestToken (AlphBridge))
assert.equal(log.payload.substr(138, 64), "54657374546f6b656e2028416c70684272696467652900000000000000000000")
})

it("should correctly deploy a wrapped asset for a token attestation", async function () {
Expand Down Expand Up @@ -297,7 +297,7 @@ contract("Bridge", function () {
assert.equal(symbol, "TT");

const name = await initializedWrappedAsset.methods.name().call();
assert.equal(name, "TestToken (Wormhole)");
assert.equal(name, "TestToken (AlphBridge)");

const decimals = await initializedWrappedAsset.methods.decimals().call();
assert.equal(decimals, 18);
Expand Down Expand Up @@ -431,7 +431,7 @@ contract("Bridge", function () {
assert.equal(symbol, "UU");

const name = await initializedWrappedAsset.methods.name().call();
assert.equal(name, "Tree (Wormhole)");
assert.equal(name, "Tree (AlphBridge)");

const decimals = await initializedWrappedAsset.methods.decimals().call();
assert.equal(decimals, 18);
Expand Down
2 changes: 1 addition & 1 deletion integration_test/src/token_bridge/transfer_token_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ async function checkWrappedToken(sourceChain: BridgeChain, targetChain: BridgeCh
const wrappedTokenId = await targetChain.getWrappedTokenId(sourceChain.chainId, normalizeTokenId(tokenId))
const wrappedTokenInfo = await targetChain.getLocalTokenInfo(wrappedTokenId)
assert(wrappedTokenInfo.symbol === sourceTokenInfo.symbol)
assert(wrappedTokenInfo.name === `${sourceTokenInfo.name} (Wormhole)`)
assert(wrappedTokenInfo.name === `${sourceTokenInfo.name} (AlphBridge)`)
assert(wrappedTokenInfo.decimals === sourceTokenInfo.decimals)
}

Expand Down
4 changes: 2 additions & 2 deletions sdk/js/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion sdk/js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@alephium/wormhole-sdk",
"version": "0.1.1",
"version": "0.1.2",
"description": "SDK for interacting with Alephium Wormhole",
"homepage": "https://wormholenetwork.com",
"main": "./lib/cjs/index.js",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"version": "v2.5.6",
"name": "RemoteTokenPool",
"bytecode": "090b09402040294032408040d841274143415f417f41a4010000000102a00102010000000104a002140b2028576f726d686f6c65294402010000000102ce0302010000000102a000020101070a004025b31600160116021603160500061708170716061604464c041606160413c3038d7ea4c68000a7b11709160416091607ab16080c334c04160616091608aba00016072a16082aa100000005090240321600ce004113157b160443102f13117b1602ce03000717051603ce0300071706160616053113167b14010116056b44ce0244ce016744160143674416014416066b4417071605ce030008170816071608020000060a02402ace0014010116016744cc1706160616004113157b1603ce024113197b1604ce012f13197b1602ce03000817071605ce0300081708160716083313167b160716082b1709160916080201000202010e16011308334c081600130a160113082b832d0216000201000202010e16011308334c081600130a160113082b832c02160002010003030010b3ce004113157ba0031602310f7b1600a1011601a1021602a103010105070112b316011602160316040005170617051600b11606aca00016062ba100160502",
"codeHash": "9f9a0a641df62cf6d831fbd7e8cdbcc7511682dd9ebf9d988ce42ae7280c6ee9",
"bytecode": "090b094022402b4034408240da412941454161418141a6010000000102a00102010000000104a002140d2028416c7068427269646765294402010000000102ce0302010000000102a000020101070a004025b31600160116021603160500061708170716061604464c041606160413c3038d7ea4c68000a7b11709160416091607ab16080c334c04160616091608aba00016072a16082aa100000005090240321600ce004113157b160443102f13117b1602ce03000717051603ce0300071706160616053113167b14010116056b44ce0244ce016744160143674416014416066b4417071605ce030008170816071608020000060a02402ace0014010116016744cc1706160616004113157b1603ce024113197b1604ce012f13197b1602ce03000817071605ce0300081708160716083313167b160716082b1709160916080201000202010e16011308334c081600130a160113082b832d0216000201000202010e16011308334c081600130a160113082b832c02160002010003030010b3ce004113157ba0031602310f7b1600a1011601a1021602a103010105070112b316011602160316040005170617051600b11606aca00016062ba100160502",
"codeHash": "1887a5c2bc109b742c33e7c8aaa448d600e258cec66dbd7ff188b17fca3da2fd",
"fieldsSig": {
"names": [
"tokenBridge",
Expand Down Expand Up @@ -284,10 +284,10 @@
],
"constants": [
{
"name": "WormholePostfix",
"name": "AlphBridgePostfix",
"value": {
"type": "ByteVec",
"value": "2028576f726d686f6c6529"
"value": "2028416c706842726964676529"
}
}
],
Expand Down
4 changes: 2 additions & 2 deletions sdk/js/src/alephium-contracts/ts/RemoteTokenPool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class Factory extends ContractFactory<
RemoteTokenPoolTypes.Fields
> {
consts = {
WormholePostfix: "2028576f726d686f6c6529",
AlphBridgePostfix: "2028416c706842726964676529",
Path: {
AttestTokenHandler: "00",
TokenBridgeForChain: "01",
Expand Down Expand Up @@ -269,7 +269,7 @@ export const RemoteTokenPool = new Factory(
Contract.fromJson(
RemoteTokenPoolContractJson,
"",
"9f9a0a641df62cf6d831fbd7e8cdbcc7511682dd9ebf9d988ce42ae7280c6ee9"
"1887a5c2bc109b742c33e7c8aaa448d600e258cec66dbd7ff188b17fca3da2fd"
)
);

Expand Down

0 comments on commit 7242e05

Please sign in to comment.