The ERC20 standard is basically a specific set of functions which developers must use in their tokens to make them ERC20 compliant. While this is not an enforced rule, most DAPP developers are encouraged to follow the standards to ensure that their tokens can undergo interactions with various wallets, exchanges and smart contracts without any issues. This was great news for everyone because now they at least had an idea of how future tokens are expected to behave. ERC20 tokens have gotten widespread approval and most of the DAPPS sold on ICO’s have
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
#config/application.rb | |
class SnakeCaseParametersMiddleware | |
def initialize(app) | |
@app = app | |
end | |
def call(env) | |
request = ActionDispatch::Request.new(env) | |
request.request_parameters.deep_transform_keys!(&:underscore) |
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
def is_anagram?(first, second) | |
first = first.split('').sort.join # get sorted string from words characters | |
second = second.split('').sort.join | |
matches = first.length == second.length # check match by length | |
return if !matches # return if words have different length | |
first.length.times do |i| # check every character in sorted string | |
matches = first[i] == second[i] |
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
class PasscodeService | |
# assume that phone can contain from 7 to 9 digits | |
PHONE_REGEXP = /^\d{7,9}$/ | |
def initialize | |
@response = { action: false, message: '' } | |
end | |
def send(phone) | |
# validate phone through regexp |