• smartcontracts's avatar
    feat(ctp): introduce Drippie and rework deploy (#2569) · 416d2e60
    smartcontracts authored
    Drippie is a helper contract for managing automatic contract
    interactions. Drippie is meant to be deployed as a middle layer between
    our contracts and other automation services like Gelato. This commit
    also revamps the deployment process to use hardhat-deploy deterministic
    deployments, ledger support, and better authentication.
    416d2e60
solidity.ts 445 Bytes
import { ethers } from 'ethers'

export const decodeSolidityRevert = (revert: string) => {
  const iface = new ethers.utils.Interface([
    {
      inputs: [
        {
          internalType: 'string',
          name: 'message',
          type: 'string',
        },
      ],
      name: 'Error',
      outputs: [],
      stateMutability: 'nonpayable',
      type: 'function',
    },
  ])

  return iface.decodeFunctionData('Error', revert)[0]
}