Skip to content

Instantly share code, notes, and snippets.

View Aleksandyr's full-sized avatar

Aleksandar Kamenov Aleksandyr

  • Sofia
View GitHub Profile
@Aleksandyr
Aleksandyr / .deps...npm...hardhat...console.sol
Created February 10, 2022 13:39
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.11+commit.d7f03943.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity >= 0.4.22 <0.9.0;
library console {
address constant CONSOLE_ADDRESS = address(0x000000000000000000636F6e736F6c652e6c6f67);
function _sendLogPayload(bytes memory payload) private view {
uint256 payloadLength = payload.length;
address consoleAddress = CONSOLE_ADDRESS;
assembly {
@Aleksandyr
Aleksandyr / FacadeStore.sol
Last active February 3, 2022 23:52
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8;
import "./Store.sol";
contract FacadeStore {
address public owner;
constructor() {
owner = msg.sender;
@Component({ name: 'render-component'})
export class RenderComponenet extends RendererComponent {
...
private processTheReflection(reflection) {
switch(reflection.kind) {
....
case ReflectionKind.GetSignature:
case ReflectionKind.SetSignature:
const accessorParent = this.getParentBasedOnType(reflection, reflection.kind);
@Component({ name: 'render-component'})
export class RenderComponenet extends RendererComponent {
...
private processTheReflection(reflection) {
switch(reflection.kind) {
case ReflectionKind.Class:
case ReflectionKind.Enum:
case ReflectionKind.Interface:
const filePath = reflection.sources[0].fileName;
const parsedPath = this.fileOperations.getProcessedDir(filePath);
@Component({ name: 'render-component'})
export class RenderComponenet extends RendererComponent {
...
private onRenderBegin(event) {
event.project.localization = this.application.options.getValue("localize");
const reflections = event.project.reflections;
const options = this.application.options.getRawValues();
const localizeOpt = options[Constants.RENDER_OPTION];
if (localizeOpt) {
@Component({ name: 'render-component'})
export class RenderComponenet extends RendererComponent {
public initialize() {
this.listenTo(this.owner, {
[RendererEvent.BEGIN]: this.onRenderBegin,
});
}
...
module.exports = (PluginHost: Application) => {
const app = PluginHost.owner;
/**
* Add Options register Component.
*/
app.options.addComponent('options-component', OptComponent);
/**
/**
* Triggers per every reflection object.
* @param reflection
*/
private resolve(context, reflection) {
switch(reflection.kind) {
...
case ReflectionKind.GetSignature:
case ReflectionKind.SetSignature:
const accessorName = reflection.parent.name;
/**
* Triggers per every reflection object.
* @param reflection
*/
private resolve(context, reflection) {
switch(reflection.kind) {
case ReflectionKind.Enum:
case ReflectionKind.Class:
case ReflectionKind.Interface:
/**
@Component({ name: 'convert-component' })
export class ConvertComponent extends ConverterComponent {
public initialize() {
this.listenTo(this.owner, {
[Converter.EVENT_RESOLVE]: this.resolve,
[Converter.EVENT_RESOLVE_BEGIN]: this.onResolveBegin,
[Converter.EVENT_RESOLVE_END]: this.onResolveEnd,
[Converter.EVENT_END]: this.onEnd,