-
Notifications
You must be signed in to change notification settings - Fork 805
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add CW->ERC pointer registry (#1499)
* Add CW->ERC pointer registry * fix tests
- Loading branch information
Showing
22 changed files
with
925 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package erc20 | ||
|
||
import "embed" | ||
|
||
const CurrentVersion uint16 = 1 | ||
|
||
//go:embed cwerc20.wasm | ||
var f embed.FS | ||
|
||
var cachedBin []byte | ||
|
||
func GetBin() []byte { | ||
if cachedBin != nil { | ||
return cachedBin | ||
} | ||
bz, err := f.ReadFile("cwerc20.wasm") | ||
if err != nil { | ||
panic("failed to read ERC20 wrapper contract wasm") | ||
} | ||
cachedBin = bz | ||
return bz | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package erc721 | ||
|
||
import "embed" | ||
|
||
const CurrentVersion uint16 = 1 | ||
|
||
//go:embed cwerc721.wasm | ||
var f embed.FS | ||
|
||
var cachedBin []byte | ||
|
||
func GetBin() []byte { | ||
if cachedBin != nil { | ||
return cachedBin | ||
} | ||
bz, err := f.ReadFile("cwerc721.wasm") | ||
if err != nil { | ||
panic("failed to read ERC721 wrapper contract wasm") | ||
} | ||
cachedBin = bz | ||
return bz | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package utils | ||
|
||
import "encoding/binary" | ||
|
||
func GetVersionBz(version uint16) []byte { | ||
res := make([]byte, 2) | ||
binary.BigEndian.PutUint16(res, version) | ||
return res | ||
} | ||
|
||
func GetCodeIDBz(codeID uint64) []byte { | ||
res := make([]byte, 8) | ||
binary.BigEndian.PutUint64(res, codeID) | ||
return res | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.