Skip to content

Instantly share code, notes, and snippets.

View EdsonAlcala's full-sized avatar

Edson Alcalá EdsonAlcala

View GitHub Profile
import hashlib
from base58 import b58encode
from cdp_agentkit_core.actions.near.segwit_addr import bech32_encode, convertbits
from eth_hash.auto import keccak
def get_evm_address(public_key: bytes) -> str:
"""
Computes the Ethereum address from an uncompressed public key.
import { NEAR_MAINNET_NETWORK_ID, NEAR_TESTNET_NETWORK_ID } from '../../../network';
import { MPC_SIGNER_MAINNET, MPC_SIGNER_TESTNET, ROOT_PUBLIC_KEY_MAINNET, ROOT_PUBLIC_KEY_TESTNET } from '../constants';
import { AddressType, deriveChildPublicKey, generateAddress, getMpcAccountIdByNetwork, getRootPublicKey } from './nearChainSignature';
describe("Chain Signature Utils", () => {
describe('deriveChildPublicKey', () => {
it('should derive a valid child public key', () => {
const accountId = "omnitester.testnet";
[
{
"type": "constructor",
"inputs": [
{
"name": "_agentAddress",
"type": "address",
"internalType": "address"
},
{
[
{
"type": "constructor",
"inputs": [
{
"name": "_agentAddress",
"type": "address",
"internalType": "address"
},
{
name: Protocol Release
on:
release:
types: [released, prereleased]
jobs:
release:
runs-on: ubuntu-latest
steps:
0x60806040523480156200001157600080fd5b50604051620028c0380380620028c0833981810160405281019062000037919062000692565b620000826040518060400160405280601e81526020017f4465706c6f79696e67207468652067656e6573697320636f6e747261637400008152506200037d60201b620000721760201c565b82826040516200009290620004ef565b6200009f9291906200081b565b604051809103906000f080158015620000bc573d6000803e3d6000fd5b506000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550620001686040518060400160405280601981526020017f546f6b656e206465706c6f79656420616464726573732025730000000000000081525060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff166200042060201b6200010b1760201c565b60005b8151811015620002a65760008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166340c10f19838381518110620001eb577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200260200101516000015184848151811062
/**
* @notice This script contains private keys, mnemonics, and API keys that serve as default values so that it executes
* even if the user has not set up their environment variables properly. Typically, these are sensitive secrets that
* should never be shared publicly and ideally should not be stored in plain text.
*/
const path = require("path");
const HDWalletProvider = require("@truffle/hdwallet-provider");
const LedgerWalletProvider = require("@umaprotocol/truffle-ledger-provider");
@EdsonAlcala
EdsonAlcala / Oracle.sol
Created October 4, 2020 09:52
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.7.2+commit.51b20bc0.js&optimize=false&gist=
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.7.0;
contract Oracle {
mapping(bytes32 => bool) public supportedIdentifier;
// Represents the status a price request has.
enum RequestStatus {
Active, // Is being voted on in the current round.
pragma solidity ^0.5.3;
contract LetterOfCredit is FiniteStateMachine {
// States
bytes32 constant REQUESTED = "requested";
bytes32 constant ISSUED = "issued";
bytes32 constant ADVISED = "advised";
bytes32 constant ACKNOWLEDGED = "acknowledged";
pragma solidity ^0.5.3;
contract SimpleStorage {
function getValue() public pure returns(uint256){
uint256 value = 1000;
return value;
}
}