Raid Guild
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Help
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    --- tags: RIPs --- # Escrow web3 notes ## abis and code ### Minion github https://github.com/raid-guild/moloch-minion contract https://github.com/raid-guild/moloch-minion/blob/develop/contracts/Minion.sol abi https://github.com/raid-guild/moloch-minion/blob/develop/src/abi/minion.json mainnet: ``` minion: { kovan: "0x98B550E95E90ADFA6D9841fAB937D81FcFEab6D2", mainnet: "0x17405148473E521b62cBCf8eBd929E8A30C4D3aA" }, dao: { kovan: "0x501f352e32ec0c981268dc5b5ba1d3661b1acbc6", mainnet: "0xbeb3e32355a933501c247e2dbde6e6ca2489bf3d" }, ``` ### Lexlocker github https://github.com/lexDAO/LexLocker/blob/lexguildlocker/LexGuildLocker.sol contract https://etherscan.io/address/0xb0d95049a9d78a1f5f111ce18f25e0294da78418#code abi https://gist.github.com/dekanbro/6341b5be4c66d83ab239a60fd0044c5e Ethereum mainnet deployment: 0x6d2A62442dAf0448561d130b40BaC6159264b1c0 LexDAO Arbitration: 0x06153608b799a3da838bf7c95fe21309d2e33b53 (need testnet deployments) ## Submitting minion proposal submit minion proposal with escrow register function to submit a minion proposal you will need to hex encode the the transaction to the lexLocker registerLocker function first lex locker function ```sol function registerLocker( // register locker for token deposit and client deal confirmation address client, // client payment address address[] calldata provider, // array of providers for spoils split (first address has the power to lock) [multisigAddress, daoAddress] address resolver, // LexDAO Arbitration address address token, // payment token (DAI) uint256[] calldata amount, // array of amounts to be paid at each milstone. example if each miles stone payment is 1000 [100, 900] uint256 cap, // must be total of all milestone amounts example if 2 milestones of [100, 900] cap would be 2000 uint256 milestones, // total number of milestones uint256 termination, // date in the future where client can take back funds 'safety valve' bytes32 details // some extra data about the escrow, not sure we'll need this for anything because we will be hydrating metadata with the database ) external {...} ``` web3js helper function `web3.eth.abi.encodeFunctionCall` example ```javascript const registerFunc = lexLockerAbi.find( func => func.name && func.name === "registerLocker" ); const hexData = web3.eth.abi.encodeFunctionCall(registerFunc, [ client, provider, resolver, token, amount, cap, milestones, termination, details) ]); // contract is the minion contract contract.methods .proposeAction(lexLockerAddr, 0, hexData, descriptionForDaoProposal) .send({ from: currentUserAddr }) ``` ## register flow * submit form data to airtable * airtable returns unique id * submit web3 minion proposal * update airtable record with txHash and/or (if Minion minion index) * when transaction is complete return url to escrow detail to raid member (if minion the deposit function should not be available until the minion proposal passes and is executed) (if not minion save escrow index) * (if not minion) submit proposal to dao with details of escrow * (if minion) this transaction has not been submitted to lexLocker yet only to the minion where it can be voted on by the dao * (if minion) when proposal passes and is processed minion transaction can be executed. I think this will have to happen manually or through the minion.raidguild.org frontend. Issue here is we will not have the lexlocker index until this is executed so i think we'll have to update the db manually. this seems to be the biggest pain here, also lexLocker registerLocker function does not return the index. ## deposit flow * (if Minion) after minion proposal has been executed the client can deposit funds * the client will have to approve the token for at least the amount of the cap * client must have at least the amount of the cap funds in address * deposit function is called with the lexLocker index ## lexLocker Events and Deposit struct can retrieve lexLocker deposit information with. * released - the released field will show how much is released and can be used to deduce the current milestone. * confirmed - the confirmed field will show if the deposit has been made yet `contract.methods.deposits(<index>)` ``` struct Deposit { address client; address[] provider; address resolver; address token; uint8 confirmed; uint8 locked; uint256[] amount; uint256 cap; uint256 released; uint256 termination; bytes32 details; } ``` ### events ``` event RegisterLocker(address indexed client, address[] indexed provider, address indexed resolver, address token, uint256[] amount, uint256 cap, uint256 index, uint256 termination, bytes32 details); event DepositLocker(uint256 indexed index, uint256 indexed cap); event Release(uint256 indexed index, uint256[] indexed milestone); event Withdraw(uint256 indexed index, uint256 indexed remainder); event Lock(address indexed sender, uint256 indexed index, bytes32 indexed details); event Resolve(address indexed resolver, uint256 indexed clientAward, uint256 indexed providerAward, uint256 index, uint256 resolutionFee, bytes32 details); ``` ## notes I would suggest using web3Modal https://github.com/Web3Modal/web3modal because it supports most providers and wallets, supports mobile deeplinking with walletConnect and has a standard interface most people are used to. And it just works

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully