Skip to content

Commit

Permalink
script: add ethda deploy script
Browse files Browse the repository at this point in the history
  • Loading branch information
x-wagmi committed May 13, 2024
1 parent 473b909 commit c357d0e
Show file tree
Hide file tree
Showing 7 changed files with 121 additions and 28 deletions.
8 changes: 4 additions & 4 deletions dataavailability/ethda/ethda.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@ func New(
return nil, fmt.Errorf("empty ethda rpc url")
}

if privKey == nil {
return nil, fmt.Errorf("empty private key")
}

return &EthdaBackend{
privKey: privKey,
ethdaRPCURL: ethdaRPCURL,
}, nil
}

func (d *EthdaBackend) Init() error {
if d.privKey == nil {
return nil
}

ethdaClient, err := blobutils.New(d.ethdaRPCURL, d.privKey)
if err != nil {
return fmt.Errorf("create ethda client: %w", err)
Expand Down
2 changes: 1 addition & 1 deletion etherman/smartcontracts/bin/ethda.bin
Original file line number Diff line number Diff line change
@@ -1 +1 @@
608060405234801561000f575f80fd5b5061001861001d565b6100da565b5f54610100900460ff16156100885760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b5f5460ff90811610156100d8575f805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b610bce806100e75f395ff3fe608060405234801561000f575f80fd5b5060043610610085575f3560e01c80638da5cb5b116100585780638da5cb5b146100f8578063d5deff3014610116578063e4f1712014610129578063f2fde38b14610168575f80fd5b80633b51be4b14610089578063715018a61461009e5780637e585d3e146100a65780638129fc1c146100f0575b5f80fd5b61009c6100973660046109bc565b61017b565b005b61009c61027f565b6065546100c69073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b61009c610292565b60335473ffffffffffffffffffffffffffffffffffffffff166100c6565b61009c610124366004610a31565b610423565b604080518082018252600581527f4574686461000000000000000000000000000000000000000000000000000000602082015290516100e79190610a6b565b61009c610176366004610a31565b610472565b60418082108061019f575060206101928284610ad4565b61019c9190610b0c565b15155b156101d6576040517f6b8eec4600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f610221856101e86041848789610b44565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284375f9201919091525061052692505050565b60655490915073ffffffffffffffffffffffffffffffffffffffff808316911614610278576040517f356a441800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050505050565b61028761054a565b6102905f6105cb565b565b5f54610100900460ff16158080156102b057505f54600160ff909116105b806102c95750303b1580156102c957505f5460ff166001145b61035a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084015b60405180910390fd5b5f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905580156103b6575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b6103be610641565b8015610420575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50565b61042b61054a565b606580547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b61047a61054a565b73ffffffffffffffffffffffffffffffffffffffff811661051d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610351565b610420816105cb565b5f805f61053385856106e0565b9150915061054081610722565b5090505b92915050565b60335473ffffffffffffffffffffffffffffffffffffffff163314610290576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610351565b6033805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b5f54610100900460ff166106d7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610351565b610290336105cb565b5f808251604103610714576020830151604084015160608501515f1a610708878285856108d4565b9450945050505061071b565b505f905060025b9250929050565b5f81600481111561073557610735610b6b565b0361073d5750565b600181600481111561075157610751610b6b565b036107b8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610351565b60028160048111156107cc576107cc610b6b565b03610833576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610351565b600381600481111561084757610847610b6b565b03610420576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610351565b5f807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561090957505f905060036109b3565b604080515f8082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa15801561095a573d5f803e3d5ffd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff81166109ad575f600192509250506109b3565b91505f90505b94509492505050565b5f805f604084860312156109ce575f80fd5b83359250602084013567ffffffffffffffff808211156109ec575f80fd5b818601915086601f8301126109ff575f80fd5b813581811115610a0d575f80fd5b876020828501011115610a1e575f80fd5b6020830194508093505050509250925092565b5f60208284031215610a41575f80fd5b813573ffffffffffffffffffffffffffffffffffffffff81168114610a64575f80fd5b9392505050565b5f6020808352835180828501525f5b81811015610a9657858101830151858201604001528201610a7a565b505f6040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b81810381811115610544577f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f82610b3f577f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b500690565b5f8085851115610b52575f80fd5b83861115610b5e575f80fd5b5050820193919092039150565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffdfea264697066735822122010fdd197f73d092becd782054513afc2e54a220206a28c0f0f39e31fe955dcca64736f6c63430008140033
6080604052606580546001600160a01b03191673f39fd6e51aad88f6f4ce6ab8827279cfffb9226617905534801561003657600080fd5b5061003f610044565b610104565b600054610100900460ff16156100b05760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff9081161015610102576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b610c01806101136000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c80638da5cb5b1161005b5780638da5cb5b146100fc578063d5deff301461011a578063e4f171201461012d578063f2fde38b1461016c57600080fd5b80633b51be4b1461008d578063715018a6146100a25780637e585d3e146100aa5780638129fc1c146100f4575b600080fd5b6100a061009b3660046109d8565b61017f565b005b6100a0610285565b6065546100ca9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6100a0610299565b60335473ffffffffffffffffffffffffffffffffffffffff166100ca565b6100a0610128366004610a54565b610430565b604080518082018252600581527f4574686461000000000000000000000000000000000000000000000000000000602082015290516100eb9190610a91565b6100a061017a366004610a54565b61047f565b6041808210806101a3575060206101968284610afd565b6101a09190610b37565b15155b156101da576040517f6b8eec4600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000610227856101ed6041848789610b72565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061053392505050565b60655490915073ffffffffffffffffffffffffffffffffffffffff80831691161461027e576040517f356a441800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050505050565b61028d610559565b61029760006105da565b565b600054610100900460ff16158080156102b95750600054600160ff909116105b806102d35750303b1580156102d3575060005460ff166001145b610364576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084015b60405180910390fd5b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905580156103c257600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b6103ca610651565b801561042d57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50565b610438610559565b606580547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b610487610559565b73ffffffffffffffffffffffffffffffffffffffff811661052a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161035b565b61042d816105da565b600080600061054285856106f1565b9150915061054f81610736565b5090505b92915050565b60335473ffffffffffffffffffffffffffffffffffffffff163314610297576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161035b565b6033805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff166106e8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e67000000000000000000000000000000000000000000606482015260840161035b565b610297336105da565b60008082516041036107275760208301516040840151606085015160001a61071b878285856108e9565b9450945050505061072f565b506000905060025b9250929050565b600081600481111561074a5761074a610b9c565b036107525750565b600181600481111561076657610766610b9c565b036107cd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161035b565b60028160048111156107e1576107e1610b9c565b03610848576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161035b565b600381600481111561085c5761085c610b9c565b0361042d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161035b565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561092057506000905060036109cf565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015610974573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff81166109c8576000600192509250506109cf565b9150600090505b94509492505050565b6000806000604084860312156109ed57600080fd5b83359250602084013567ffffffffffffffff80821115610a0c57600080fd5b818601915086601f830112610a2057600080fd5b813581811115610a2f57600080fd5b876020828501011115610a4157600080fd5b6020830194508093505050509250925092565b600060208284031215610a6657600080fd5b813573ffffffffffffffffffffffffffffffffffffffff81168114610a8a57600080fd5b9392505050565b600060208083528351808285015260005b81811015610abe57858101830151858201604001528201610aa2565b5060006040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b81810381811115610553577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600082610b6d577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500690565b60008085851115610b8257600080fd5b83861115610b8f57600080fd5b5050820193919092039150565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fdfea264697066735822122031cde34584e7676e8f672335a3a4fd3d2b0ce9c76233c5b38113ce5535de00ef64736f6c63430008110033
Loading

0 comments on commit c357d0e

Please sign in to comment.