… in 25 lines of code!
Jun 14, 2024 • 6 min read
… in 25 lines of code!
Jun 14, 2024 • 6 min read
The content of the SWC registry has not been thoroughly updated since 2020. It is known to be incomplete and may contain errors as well as crucial omissions.
For currently maintained guidance on known Smart Contract vulnerabilities written primarily as guidance for security reviewers, please see the EEA EthTrust Security Levels specification. As well as the latest release version, an Editor’s draft is available, that represents the latest work of the group developing the specification.
General guidance for developers on how to ensure security, that is currently maintained, is also available through the Smart Contract Security Verification Standard (SCSVS), or the Smart Contract Security Field Guide.
The following table contains an overview of the SWC registry. Eac
| require 'net/http' | |
| require 'json' | |
| uri = URI('http://localhost:8000/v1/chat/completions') | |
| request = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json') | |
| request.body = { | |
| model: 'meta-llama/Llama-3.2-1B', | |
| messages: [{ role: 'user', content: ARGV[0] }], | |
| chat_template: "{% for message in messages %}{{'\u003chuman\u003e' if message.role == 'user' else '\u003cassistant\u003e'}}{{ message.content }}{% if not loop.last %}{{ '\\n' }}{% endif %}{% endfor %}{% if add_generation_prompt %}\\n\u003cassistant\u003e{% endif %}", | |
| max_tokens: 100, |
The idea of a snail crawling from Earth to Mars is a fun hypothetical scenario! While it's not physically possible for a snail to survive and move through space, we can calculate how long it would take based on average distances and the snail's typical speed.
The distance between Earth and Mars varies due to their elliptical orbits around the Sun:
The idea of a snail crawling from Earth to Mars
The idea of a snail crawling from Earth to Mars
| import av | |
| import numpy as np | |
| import mlx.core as mx | |
| def conway(a: mx.array): | |
| source = """ | |
| uint i = thread_position_in_grid.x; | |
| uint j = thread_position_in_grid.y; | |
| uint n = threads_per_grid.x; |
| import git | |
| def summarize_diffs(path: str, suffix: str) -> str: | |
| repo = git.Repo(path) | |
| index = repo.index | |
| result = "" | |
| # Get the staged changes as a text diff | |
| staged_diff = index.diff( | |
| "HEAD", |
| https://github.com/juzzlin/Heimer | |
| https://github.com/dvorka/mindforger | |
| // Literal type | |
| type Drinks = 'Coke' | 'Milk' | 'Water' | 'Coffee'; | |
| type UnUnite<T, K> = T extends K ? never : T; | |
| type Result = UnUnite<string | number | boolean, string>; // Result: number | boolean | |
| type HealthDrinks = UnUnite<Drinks, 'Coke'>; | |
| // `infer` | |
| // "destructuring type". "Pattern matching" |