This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Migration of the SanR dApp (https://sanr.app) from ethers v5 to ethers v6 | |
## Introduction | |
SanR, a decentralized application (dApp) built on the Ethereum blockchain, recently underwent a migration from ethers v5 to ethers v6. This migration involved several changes in the codebase to ensure compatibility and leverage the enhanced features and improvements introduced in the latest version of ethers.js. In this article, we will explore the key modifications made during the migration process and their implications for the SanR dApp. | |
## Transition from BigNumber to BigInt | |
One significant change in ethers v6 is the replacement of the BigNumber class with [BigInt](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt). BigInt provides more precise handling of large numbers and aligns with the JavaScript standard. It is important to note that JavaScript requires explicit conversion from BigInt to perform operations with regular numbers (Number). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[{"timestamp":1673032195,"fullMoon":true},{"timestamp":1674320130,"fullMoon":false},{"timestamp":1675607444,"fullMoon":true},{"timestamp":1676862545,"fullMoon":false},{"timestamp":1678178569,"fullMoon":true},{"timestamp":1679405204,"fullMoon":false},{"timestamp":1680745038,"fullMoon":true},{"timestamp":1681953348,"fullMoon":false},{"timestamp":1683297407,"fullMoon":true},{"timestamp":1684500956,"fullMoon":false},{"timestamp":1685839436,"fullMoon":true},{"timestamp":1687052350,"fullMoon":false},{"timestamp":1688373630,"fullMoon":true},{"timestamp":1689607986,"fullMoon":false},{"timestamp":1690904006,"fullMoon":true},{"timestamp":1692167929,"fullMoon":false},{"timestamp":1693435025,"fullMoon":true},{"timestamp":1694731205,"fullMoon":false},{"timestamp":1695970701,"fullMoon":true},{"timestamp":1697295308,"fullMoon":false},{"timestamp":1698513867,"fullMoon":true},{"timestamp":1699853235,"fullMoon":false},{"timestamp":1701062201,"fullMoon":true},{"timestamp":1702409527,"fullMoon":false},{"timestamp":1703622823,"fu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// y = (x - xa) * (yb - ya) / (xb - xa) + ya | |
window.x = () => { // eslint-disable-line | |
const [xa, ya] = [-63, 4868.00]; | |
const [xb, yb] = [-42, 4778.75]; | |
const a = (yb - ya) / (xb - xa); | |
// const y = x * (yb - ya) / (xb - xa) - xa * (yb - ya) / (xb - xa) + ya; | |
// const b = x11 * (y12 - y11) / (x12 - x11) + y11; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {StoredAuth} from 'r/utils/Stored'; | |
import sleep from 'r/utils/sleep'; | |
import showNotification from 'r/utils/showNotification'; | |
import fetch from 'r/utils/fetch'; | |
const GET = 'GET'; | |
const POST = 'POST'; | |
const PUT = 'PUT'; | |
const DELETE = 'DELETE'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const {exec} = require('child_process'); | |
setInterval(() => { | |
exec('tput bel', (error, stdout, stderr) => { | |
if (error) { | |
console.log(`error: ${error.message}`); | |
return; | |
} | |
if (stderr) { | |
console.log(`stderr: ${stderr}`); | |
return; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* global module, __dirname */ | |
/* eslint-disable import/no-commonjs, import/no-nodejs-modules */ | |
const path = require('path'); | |
module.exports = { | |
globals: { | |
require: 'readonly', | |
process: 'readonly', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default [ | |
{ | |
inputs: [ | |
{ | |
internalType: 'string', | |
name: 'name', | |
type: 'string', | |
}, | |
{ | |
internalType: 'string', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {ethers} from 'ethers'; | |
import {cloneDeepWith} from 'lodash'; | |
export default function logBNs(arg) { | |
function customizer(value) { | |
if (Array.isArray(value)) { | |
const arr = []; | |
Object.keys(value).forEach(key => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Company | |
FAQ Парковки Вакансии Новости Контакты | |
En | |
Офертаконфиденциальности | |
ШЕРИНГА САМОКАТОВ WHOOSH | |
Политика | |
Мы делаем все процессы сервиса Whoosh максимально прозрачными, в том числе то, как мы собираем, используем и защищаем персональную информацию своих пользователей. В этом документе — Политике конфиденциальности, описывается, как обрабатываем персональные данные, которые получаем при взаимодействии пользователей с нашим сайтом, мобильными приложениями и иными службами (всё вместе мы будем называть это — Сервис). Пожалуйста, с полными условиями использования Whoosh ознакомьтесь в Оферте сервиса. | |
Мы оставляем за собой право время от времени изменять настоящую Политику конфиденциальности. Если в этот документ будут внесены изменения, обновленная версия сразу же будет опубликована на сайте и в мобильных приложениях Сервиса, в случае существенных изменений пользователям будет направлено уведомление по электронной почте или другим способом. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ОфертаофертаШЕРИНГА САМОКАТОВ WHOOSH | |
Публичная | |
ПУБЛИЧНАЯ ОФЕРТА | |
о заключении Договора о предоставлении права использования Платформы микромобильности Whoosh (Условия использования сервиса) | |
Место заключения договора: г. Москва, Российская Федерация | |
(редакция от «01» мая 2021 года) |
NewerOlder