Coder Social home page Coder Social logo

acala-solidity's Introduction

Solidity Smart Contract Challenge

This is my attempt to complete the ERC20 upgradeable smart contract. NOTE: This is my initial attempt, and is not complete. The things I have gotten stuck on and am still working on are:

  1. The contract currently returns 100% of ETH, not 90%. I will need to figure out how to use fractional values in solidity, as math with decimal values like 0.9 is more complicated.
  2. The contract does not have a kill switch to turn off upgradeability. Since I am using OZ's upgradeable proxy contract, my immediate thought is to have a function and a flag that indicates if upgradeability is has been turned on or off. If off, then the transaction calling for an upgrade should fail. Since the upgradeability logic lies in the proxy contract, I may need to dig in to OZ's implementation.

Most of the relevant code for this challenge was done in contracts/. The migrations/ folder contains nothing special, besides using the OZ functions from their upgradeable plugin. Finally, the tests/ directory contains some pretty in-depth testing of the contracts I did before deploying to Kovan.

Transaction deploys smart contracts:

https://kovan.etherscan.io/tx/0x225eb3b42738494f2f074ae27296c36d3adcab73944de1c01a71a92d3d924665 https://kovan.etherscan.io/tx/0xf90abec50e8126966cfabf0b126dd903c877822318a97210ce57969064f08a48 (deploy proxy)

Transaction sends ETH to mint ERC20 token:

https://kovan.etherscan.io/tx/0xaaa4d2c5a25bd391eeeb0c0499a09c3a481974d9290af7f9c16a2001727ae75e

Transaction performs upgrade:

https://kovan.etherscan.io/tx/0xa2f0964cf3bfaf753433e17281b6bf97734a66685f026fd227760df7149a67f5

Transaction performs kill switch:

TODO

Transaction that burn ERC20 token and receive ETH:

https://kovan.etherscan.io/tx/0x92077377b81606536407c070081b3b9c4ab76c0a37eac0c785985f85c53a8d52

acala-solidity's People

Contributors

oslfmt avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.