Skip to content

Instantly share code, notes, and snippets.

Avatar
🛳️
I ship

Pong Cheecharern Pongch

🛳️
I ship
View GitHub Profile
View etheremChecksumTest.go
func TestIsChecksum(t *testing.T) {
t.Run("should return false if checksum is wrong", func(t *testing.T) {
wrongcheck := "0xc1912fEE45d61C87Cc5EA59DaE31190FFFFf232D"
if isChecksum(wrongcheck) {
t.Errorf("expected \n %v, got \n %v \n", true, isChecksum(wrongcheck))
}
})
t.Run("should return true if checksum is correct", func(t *testing.T) {
rightcheck := "0xc1912fEE45d61C87Cc5EA59DaE31190FFFFf232d" //last char is uppercase
if !isChecksum(rightcheck) {
View ethereumChecksum.go
package checksum
import (
"encoding/hex"
"golang.org/x/crypto/sha3"
"strconv"
"strings"
)
func checksum(address string) string {
View ethvault.json
[
{
"constant": true,
"inputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
View pre_lum_erc20.go
// Code generated - DO NOT EDIT.
// This file is a generated binding and any manual changes will be lost.
package ERC20Vault
import (
"math/big"
"strings"
"github.com/ethereum/go-ethereum/accounts/abi"
View pre_lum_eth_vault.go
// Code generated - DO NOT EDIT.
// This file is a generated binding and any manual changes will be lost.
package EthVault
import (
"math/big"
"strings"
"github.com/ethereum/go-ethereum/accounts/abi"
View pre_lum_plasma_framework.go
// Code generated - DO NOT EDIT.
// This file is a generated binding and any manual changes will be lost.
package PlasmaFramework
import (
"math/big"
"strings"
ethereum "github.com/ethereum/go-ethereum"
View pre_lum_payment_exitgame.go
// Code generated - DO NOT EDIT.
// This file is a generated binding and any manual changes will be lost.
package PaymentExitGame
import (
"math/big"
"strings"
ethereum "github.com/ethereum/go-ethereum"
View PaymentExitGame.go
// Code generated - DO NOT EDIT.
// This file is a generated binding and any manual changes will be lost.
package PaymentExitGame
import (
"math/big"
"strings"
ethereum "github.com/ethereum/go-ethereum"
View plasma_framework.go
// Code generated - DO NOT EDIT.
// This file is a generated binding and any manual changes will be lost.
package PlasmaFramework
import (
"math/big"
"strings"
ethereum "github.com/ethereum/go-ethereum"
View erc20_vault.go
// Code generated - DO NOT EDIT.
// This file is a generated binding and any manual changes will be lost.
package Erc20Vault
import (
"math/big"
"strings"
ethereum "github.com/ethereum/go-ethereum"