teleren/devto huggingface dataset:
Token con Fees en Uniswap V3 ¿Es posible?
Tags: blockchain, web3, solidity
Published: 2023-02-07 19:03:38

---
title: Token con Fees en Uniswap V3 ¿Es posible?
published: true
description: 
tags: blockchain, web3, solidity
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/owy049bu10uriqotzbg4.png
# Use a ratio of 100:42 for best results.
# published_at: 2022-11-21 21:53 +0000
---

Uniswap fue lanzado en 2021 y hoy es el DEX que tiene más volumen. En este video damos un vistazo a cómo funciona la liquidez concentrada por medio de NFTs y también lanzaremos un Token que extrae comisiones porcentuales en compra y P2P. Cabe mencionar que a pesar que Uniswap menciona que [no es posible hacer tokens con fees](https://docs.uniswap.org/concepts/protocol/integration-issues) sí es posible siempre y cuando no se implementen fees en la venta del token.

{%youtube XaHmTjNoVJs%}

## Antes de comenzar

Para este tutorial ocuparás [Metamask](https://metamask.io/) u otra wallet compatible con fondos en Goerli que puedes obtener desde un [faucet](https://goerlifaucet.com/).

## Contrato con tokens de Fees en Uniswap V3

Puedes lanzar el siguiente token tanto en Mainnet como en Goerli pues los contratos de Uniswap comparten [los mismos addresses](https://docs.uniswap.org/contracts/v3/reference/deployments). Sin embargo deberás ajustar el address del `Base Token`, el address de WETH en Mainnet es `0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2` y en Goerli `0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6`.

Puedes encontrar este contrato y más en la [Biblioteca](https://github.com/FilosofiaCodigo/Biblioteca) y el detalle de los parámetros en la [Documentación](https://github.com/FilosofiaCodigo/Biblioteca/blob/master/docs/ERC20/UniswapV3FeeToken.md).

```solidity
// SPDX-License-Identifier: MIT
pragma solidity 0.8.18;

import "biblioteca/contracts/ERC20/UniswapV3FeeToken.sol";

contract MyUniswapV3FeeToken is UniswapV3FeeToken
{
    constructor() UniswapV3FeeToken(
        "My Token", "MTKN",                         // Name and Symbol
        1_000_000_000 ether,                        // 1 billion supply
        100, 200,                                   // Fees: 1% buy 2% P2P
        msg.sender,                                 // Vault Address
        0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6, // Base token: WETH
        1_000_000)                                  // Initial rate: 1 WETH = 1,000,000 tokens
    {
    }
}
```

**Gracias por ver este video!**

Sígannos en dev.to y en [Youtube](https://www.youtube.com/channel/UCNRB4tgwp09z4391JRjEsRA) para todo lo relacionado al desarrollo en Blockchain en Español.
How to gain experience fast as a Developer 🚀
Tags: beginners, motivation, programming, productivity
Published: 2023-02-07 18:46:47

As a beginner in the tech industry, getting hands-on experience can be challenging 🤔. However, acquiring experience is crucial for your professional growth and career advancement 💼. Here are some practical tips to help you gain experience quickly in the field of software development 👨‍💻.

**1. Participate in online coding challenges 💻:** Online coding challenges are a great way to improve your coding skills and gain experience 📈. Sites like Codewars, HackerRank, and LeetCode offer a wide range of challenges that you can solve in your spare time 🕰️.

**2. Contribute to open-source projects 🔧:** Contributing to open-source projects is a fantastic way to gain experience, improve your coding skills, and build your portfolio 💼. Choose a project that interests you, like contributing to the development of a popular text editor like Atom or Sublime Text, and start contributing to it by fixing bugs or adding new features 🔨.

**3. Participate in hackathons 💻:** Hackathons are events where developers gather to build projects in a short amount of time 🕰️. Participating in a hackathon can help you learn new technologies 💻, network with other developers 🤝, and gain hands-on experience 💪.

**4. Start your own side project 🚀:** Developing your own side project is a great way to apply the skills you have learned and gain experience 📈. Choose a project that interests you, like building a weather app or a to-do list, and work on it in your spare time 🕰️. You can also share your project on Github and get feedback from other developers 👨‍💻.

**5. Mentorship 🧑‍🏫:** Consider finding a mentor in the tech industry who can guide you and help you gain experience 💡. A mentor can provide valuable insights and advice on how to improve your skills and succeed in your career 💼.

**6. Networking 🤝:** Attend local meetups, conferences, and events to network with other developers 💻. This will give you the opportunity to learn about new technologies 💡, meet potential employers 💼, and gain experience 📈.

By following these tips 💡, you can gain experience quickly in the field of software development 🚀. Remember, the key to success is to never stop learning and improving your skills 💪.

Let us know in the comments below 💬, which tip resonated with you the most and how you plan on applying it in your journey to gain experience fast 🚀. Good luck on your journey! 🚀
Deploy Vite React App on Github
Tags: devops, vite, react, typescript
Published: 2023-02-07 18:40:19

Follow two step to publish

## Step: 1 
**Configure repo in `vite.config.js`**

Set the `base` in `vite.config.js`.

If you are deploying to `https://<USERNAME>.github.io/`, you can omit base as it defaults to `"/"`.


If you are deploying to `https://<USERNAME>.github.io/<YOUR_REPO_NAME>/`, for example your repository is at `https://github.com/hidaytrahman/chepo`, then set base to `"/chepo/"`.

Example: 
```javascript
export default defineConfig({
  base: "/<YOUR_REPO_NAME>/", // add the base as repo name as "/yourRepoName/"
  plugins: [react()],
});
```

## Step: 2
**Install and setup `gh-pages`**

Now, Install the `gh-pages` package

`yarn add -D gh-pages` or `npm install gh-pages --save-dev`

Add below line in the `package.json` file
``` 
 "homepage": "https://<USERNAME>.github.io/<YOUR_REPO_NAME>/",
```

Also add these beautiful scripts
```javascript
 "predeploy": "npm run build",
 "deploy": "gh-pages -d dist"
```

we are done with the configuration, let's run the command to deploy.

```yarn run deploy```

Or

```npm run deploy```

Yayyy!!! see it in action in 2-3 minutes.

<img src="https://media1.giphy.com/media/2wYYlHuEw1UcsJYgAA/giphy.gif?cid=ecf05e470dtk70zo6wrnggvdxx8c9tvhns0bpqoya78vu8by&rid=giphy.gif&ct=g" />
My progress in #icodethis daily UI challenge
Tags: tailwindcss, html, css, javascript
Published: 2023-02-07 18:31:40

Hi folks, I am participating in the daily UI challenge on [icodethis.com](https://www.icodethis.com/)

These challenges are to practice HTML/CSS skills and you get bonus points for adding JS and animations.

I have used the tailwind CSS framework for all these projects to practice it more.

Here are my first 6 completed challenges:

## Calendar

{% codesandbox calendar-tailwind-otlyf9 %}


## Calendar 2

{% codesandbox calendar-meeting-tailwind-x244i0 %}


## AppList

{% codesandbox apps-list-tailwind-jimvrj %}


## FAQ

{% codesandbox faq-tailwind-n6yiim %}


## Followers

{% codesandbox followers-tailwind-1mgcf6 %}


## Newsletter

{% codesandbox newsletter-tailwind-3tsgz6 %}


You can check my submissions here
{% embed https://www.icodethis.com/AneeqaKhan %}


### Thank you for reading!
Connect with me
- [Twitter](https://twitter.com/Aneeqa_Khan25)
- [LinkedIn](https://www.linkedin.com/in/aneeqa-khan-990459135/)
- [GitHub](https://github.com/AneeqaKhan)
Code Refactoring for Mobile Apps: A Guide for Developers
Tags: android, ios, apps
Published: 2023-02-07 18:29:57

Code refactoring is a crucial step in the development process that helps to improve the quality, maintainability, and performance of code. It's especially important for mobile apps as they run on limited hardware resources and need to be optimized for different screen sizes, resolutions, and operating systems. In this blog, we'll explore the importance of code refactoring for mobile apps and provide practical tips for developers.

Why is Code Refactoring Important for Mobile Apps?

    Improved User Experience: By optimizing the code, you can reduce app crashes, improve the app's responsiveness, and provide a better user experience.

    Better Performance: Refactoring helps to improve the performance of mobile apps by reducing the size of the codebase, improving memory usage, and reducing the number of network requests.

    Easier Maintenance: Well-structured and optimized code is easier to maintain, making it easier for developers to add new features, fix bugs, and make improvements.

Tips for Code Refactoring for Mobile Apps:

    Start with a Code Audit: Before refactoring, perform a code audit to identify areas that need improvement. Look for duplicated code, unused variables, and complex code that can be simplified.

    Use Tools: There are many tools available to help you refactor your code, such as Lint, SonarQube, and Android Studio's built-in code analyzer.

    Follow Best Practices: Adhere to best practices for writing clean, maintainable code. This includes using proper indentation, descriptive variable names, and concise code.

    Test, Test, Test: After refactoring, thoroughly test your code to ensure that it still behaves as expected. Make sure to test on different devices and operating systems to catch any potential compatibility issues.

In conclusion, code refactoring is an essential step in the development of mobile apps. By following these tips and best practices, you can ensure that your code is well-structured, optimized, and maintainable. Happy coding!
create module
Published: 2023-02-07 18:24:35

create module 
```rb 
module MyFirstModule
    def say_hello
        puts "Hello"
    end
end
```
using created module 
```rb 
module MyFirstModule
    def say_hello
        puts "Hello"
    end
end

class ModuleTester
    include MyFirstModule
end

mt = ModuleTester.new 
mt.say_hello
```
Lodash
Tags: webdev, javascript, programming, tutorial
Published: 2023-02-07 18:23:56

What is Lodash and why to use?

1. Lodash is a JavaScript library.
2. It helps in working with arrays,strings,objects,numbers,etc.
3. It provides us with various inbuilt functions.
4. It uses a functional programming approach which that coding in JavaScript easier to understand because instead of writing repetitive functions, tasks can be accomplished with a single line of code.
5. It also makes it easier to work with objects in JavaScript if they require a lot of manipulation to be done upon them.

Why Lodash?

It provides various inbuilt functions for collections, arrays, to manipulate objects, and other utility methods that we can use directly instead of writing them from scratch. 

It makes it easier to iterate over the arrays, strings as well as objects. Its modular methods enable the creation of composite functions easier.
How to Get Mentorship — Without Hiring a Mentor
Tags: webdev, career, beginners, codenewbie
Published: 2023-02-07 18:20:58

![How to delay your growth: Take feedback lightly](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cbrjqccsf1cr23nmpyaf.png)

 #1 mistake I made as a developer:

Not seeking feedback

In this article, I am sharing 5 ways you can get guidance and valuable feedback in your developer journey without 1:1 mentorship.

Let's go! 🚀

## TL;DR

- [Open source your code 📖](#open-source-your-code)
- [Pair program with peers 👥](#pair-program-with-peers)
- [Join Developer Communities 👪](#join-developer-communities)
- [Build in public 🔨](#build-in-public)
- [Get your code reviewed by peers 🖥️](#get-your-code-reviewed-by-peers)

## Open source your code 📖

Open source refers to making code publicly accessible for people to use and contribute under a license

Benefits of open source:
- Proof of skills
- Genuine Networking
- Better software quality


![open source everywhere](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ipuzky5nhp4xlhqkxef5.png)

## Pair program with peers 👥

Every developer has a different approach to problem solving.

Coding with a peer will expose you to their techniques.

While pair programming you get to:
- Learn
- Teach
- Practice communication skills

which solidifies your understanding of the topic

## Join Developer Communities 👪 

Communities are the easiest way to grow as a developer.

In a community, you can get feedback by:
- Working with senior devs
- Asking technical questions
- Sharing your work

You will learn a lot more than just coding.


![you don't have to code alone](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/881bueyzm5osbx0uihr0.png)

## Build in public 🔨

Building in public is building software with transparently sharing the behind scenes.

You get to brainstorm with people following your journey; On any topic such as:
- Feature ideas
- Tech stack
- Website design, etc

It's a collaboration of highest order.

## Get your code reviewed by peers 🖥️

Code review is a practice of other developers checking your code after you write it.

Code reviews are a great way to:
- Learn from peers
- Reduce bugs in code
- Improve code quality

You get better with each code review.

![code wtfs](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rhc62aewib5dwceleryp.png)

## Wrapping Up

Hope you found these tips helpful.

If you liked this post, follow me for more of these 🙂

Also, share what kind of mentorship are you seeking in your career?👇
Database Subsetting and Relational Data Browsing Tool.
Tags: database, subsetter, opensource, tool
Published: 2023-02-07 18:09:26

# Jailer Database Tool
(https://github.com/Wisser/Jailer)
Jailer is a tool for database subsetting and relational data browsing.

 - The Subsetter creates small slices from your database (consistent and referentially intact)
   as SQL (topologically sorted), DbUnit records or XML.
   
   Ideal for creating small samples of test data or for local problem analysis with relevant production data.
   
 - The Data Browser lets you navigate through your database following the relationships (foreign key-based or user-defined) between tables.

<img src="/docs/screenshot.png" width="500" />

https://user-images.githubusercontent.com/861721/142761281-299bddc4-eea7-4f26-8c24-54fccb31b152.mp4

[More Videos](https://wisser.github.io/Jailer/videos.html)

## Features

 - Exports consistent and referentially intact row-sets from your productive database
   and imports the data into your development and test environment.
 - Improves database performance by removing and archiving obsolete data without violating integrity.
 - Generates topologically sorted SQL-DML, hierarchically structured XML and DbUnit datasets.
 - Data Browsing. Navigate bidirectionally through the database by following foreign-key-based or user-defined relationships.
 - SQL Console with code completion, syntax highlighting and database metadata visualization.
 - A demo database is included with which you can get a first impression without any configuration effort.

## Supported Databases

Thanks to the JDBC technology used, any DMBS is in principle supported. For best results, specific additional support features are useful, however. These are available for:

 - PostgreSQL
 - Oracle
 - MySQL
 - MariaDB
 - Microsoft SQL Server
 - IBM Db2
 - SQLite
 - Sybase
 - Amazon Redshift
 - Firebird
 - Informix Dynamic Server
 - H2
 - Exasol
TIL: How to install a specific Phoenix version
Tags: beginners, elixir, phoenix, liveview
Published: 2023-02-07 18:05:01

When you open the [Phoenix Framework website](https://www.phoenixframework.org/), you will see a section on the right-side called **"Try it now"**, where you will install the Phoenix project generator.

```shell
$ mix archive.install hex phx_new
```

Nice, but if I want to choose which version I want, So I need to **_uninstall_** any `phx_new` version installed first, and then I can choose which version I want to install.

```shell
$ mix archive.uninstall phx_new
$ mix archive.install hex phx_new VERSION
```

Install Phoenix 1.7 release candidate and LiveView 0.18:

```shell
$ mix archive.install hex phx_new 1.7.0-rc.2
```
constant
Published: 2023-02-07 18:00:03

```rb 
class Ticket 
    VENUES = ["Convention center", "Fairy", "Town hall" ]

    def initialize(venue, date)
        if VENUES.include?(venue)
            @venue = venue 
        else  
            raise ArgumentError, "Unknown venue #{venue}"
        end
        @date = date 
    end
end

puts "the venues are: "
puts Ticket::VENUES
```

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gpybn74blmshjd230bll.png)

change constant 
```rb
#change constant 
venues = Ticket::VENUES
venues << "High school Gym"
```

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0c49zm74hc31qm7iagki.png)
Speech Recognition with STM32: Building hands-free voice experiences
Tags: 100daysofcode, challenge, programming, machinelearning
Published: 2023-02-07 17:50:01

On day 27, we'll build hands-free voice experience on an STM32 recognizing commands like: 
`Picovoice, turn on the light in the living room.`
For this tutorial, we use the STM32F407 discovery board which costs $20.

**Run the demo**
You will need the [dev board](https://www.st.com/en/evaluation-tools/stm32f4discovery.html) and [STM32CubeIDE](https://www.st.com/en/development-tools/stm32cubeide.html) installed.

**Clone the Picovoice repository.**

```
git clone --recurse-submodules \
https://github.com/Picovoice/picovoice.git
```
Open the project under `/demo/mcu/stm32f407/` using STM32CubeIDE.

You need to download the [audio middleware] (https://www.st.com/en/embedded-software/stm32cubef4.html). Once downloaded, find the `Middlewares` folder and replace the empty `Middlewares` folder in the project with that.

Sign up for [Picovoice Console](https://console.picovoice.ai/) for free and copy your `AccessKey`.

**AccessKey**
In `main.c`, insert your `AccessKey` string in the line:

```
static const char* ACCESS_KEY = ...
```
Build and load the project into your board. The demo uses Serial Wire Viewer (SWV) to return log messages. Assure this works, and you can monitor it.

Say:
`Picovoice, turn on the light in the living room`
You should see the following in the debug console:
```
UID:  2c 00 55 00 13 51 37 34 34 37 33 32

[wake word]
{
    is_understood : 'true',
    intent : 'changeLightState',
    slots : {
        'state' : 'on',
        'location' : 'living room',
    }
}
```
The UUID is the unique identifier of the ST MCU on the board. We will need it for training custom models. The rest shows that the firmware understood the wake phrase Picovoice using the [Porcupine Wake Word](https://picovoice.ai/platform/porcupine/) engine, and the follow-on voice command turn on the light in the living room using [Rhino Speech-to-Intent](https://picovoice.ai/platform/rhino/) engine.

If you want to train a custom wake word and context you can continue to follow the steps in [this tutorial](https://picovoice.ai/blog/offline-voice-assistant-on-an-stm32-microcontroller/)
Rethinking the "Composition over Inheritance" principle : When Software Engineers should abandon it?
Tags: ruby, rails, oop, designpatterns
Published: 2023-02-07 17:44:02

- The statement "Composition over Inheritance" is a widely accepted principle in object-oriented programming, but is it always the best approach? While composition does offer more flexibility and modularity, there are situations where inheritance can be a better option. It all depends on multiple factors, such as the complexity of the object hierarchy, the amount of code reuse required, and how we want to model our objects in the real world, which is the point I want to elaborate in this post.

- First, let's talk about the purpose of using inheritance in the first place. There are many different benefits, and here is one of them, it is a powerful feature of object-oriented programming languages that allows us as developers to create a clear and concise representation of the relationships between different objects. Using it, we can define a base class that contains common properties and behaviors and then let the sub/children classes inherit from that base class to create more specialized features. This reduces the need to duplicate code and makes it easier to maintain and update it over time.

- Secondly, this clear and concise representation of the natural world objects is important because it makes our code base easier to read and understand. At the same time, we can use composition to make it loosely coupled. Still, everything has trade-offs in software engineering, and the trade-off we make here is the question that other fellow developers will likely ask, "Why do we not just use inheritance here?" that can lead to more confusion when our team scales in the future.

- Finally, the principle is just a guideline, and we need to understand why we use it to know when we should use it and when not. Just because the majority widely accepts this principle doesn't mean we should apply it everywhere in our codebase. Otherwise, what is the point of critical thinking and creative problem-solving in software engineering?

- I have attached two trivial examples to illustrate my point. Let me know what you think in the comment section. Or reply to this intriguing question, "What are the other scenarios you think we should prefer inheritance over composition?"

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/stb38f0maxi4dh33g0rd.png)