Skip to content

Commit

Permalink
Merge branch 'master' into v11
Browse files Browse the repository at this point in the history
  • Loading branch information
julien51 committed Aug 5, 2022
2 parents 91fb205 + a33324d commit 349eb65
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,9 @@ interface IPublicLock
* Allows a Lock manager to add or remove an event hook
* @param _onKeyPurchaseHook Hook called when the `purchase` function is called
* @param _onKeyCancelHook Hook called when the internal `_cancelAndRefund` function is called
* TODO: ADD MORE
* @param _onValidKeyHook Hook called to determine if the contract should overide the status for a given address
* @param _onTokenURIHook Hook called to generate a data URI used for NFT metadata
* @param _onKeyTransferHook Hook called when a key is transfered
*/
function setEventHooks(
address _onKeyPurchaseHook,
Expand Down
2 changes: 2 additions & 0 deletions packages/contracts/src/contracts/PublicLock/IPublicLockV9.sol
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@ interface IPublicLockV9
* Allows a Lock manager to add or remove an event hook
* @param _onKeyPurchaseHook Hook called when the `purchase` function is called
* @param _onKeyCancelHook Hook called when the internal `_cancelAndRefund` function is called
* @param _onValidKeyHook Hook called to determine if the contract should overide the status for a given address
* @param _onTokenURIHook Hook called to generate a data URI used for NFT metadata
*/
function setEventHooks(
address _onKeyPurchaseHook,
Expand Down
2 changes: 1 addition & 1 deletion packages/contracts/src/contracts/utils/LockSerializer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pragma solidity ^0.8.2;

import 'hardhat/console.sol';
import '@unlock-protocol/contracts/dist/PublicLock/IPublicLockV8sol8.sol';
import '../PublicLock/IPublicLockV8sol8.sol';

contract LockSerializer {

Expand Down
1 change: 1 addition & 0 deletions packages/ui/lib/components/CodeBox/CodeBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ interface Props {

export function CodeBox({ lang, code }: Props) {
return (
// @ts-expect-error
<Highlight
{...defaultProps}
theme={UnlockPrismTheme}
Expand Down
22 changes: 14 additions & 8 deletions scripts/docs-contracts-pr.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#! /bin/sh

# Exit on error
set -e

# ==============================================================================
# This script is used to generate the documentation for the contracts.
# It will : 1) fetch the package from npm and 2) opens a PR in the docs repo
Expand All @@ -15,14 +18,15 @@
# use tmp dir
tmpdir=$(mktemp -d)
dest="docs/core-protocol/smart-contracts-api"
base="master" # "css-update"
base="master"
repo=git@github.com:unlock-protocol/docs.git
FROM_NPM=${FROM_NPM:-1}
FROM_NPM=${FROM_NPM:-0}

# get contracts tarball
if [ "$FROM_NPM" -eq "1" ]; then
wget $(npm view @unlock-protocol/contracts dist.tarball) -P $tmpdir
else
yarn workspace @unlock-protocol/contracts clean
yarn workspace @unlock-protocol/contracts build
yarn workspace @unlock-protocol/contracts pack --out "$tmpdir/contracts-%v.tgz"
fi
Expand All @@ -34,20 +38,22 @@ tar -xf contracts-**.tgz
# versioning
version_number="$(ls *.tgz | awk -F \- {'print substr($2,0,5) '} | sed 's/\./-/g')"
branch=contracts-$version_number
rm -rf *.tgz

# git worflow
git clone $repo
cd docs

# cleanup
rm -rf *.tgz

# check if a branch already exists
if $(git ls-remote --heads ${repo} ${branch} | grep ${branch} >/dev/null); then
echo "Branch ${branch} already exists, pushing to existing branch";
git fetch origin $branch
git checkout $branch
echo "Branch ${branch} already exists, pushing to existing branch";
git fetch origin $branch
git checkout $branch
else
git checkout $base
git checkout -b $branch
git checkout $base
git checkout -b $branch
fi

# copy new docs files over
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pragma solidity >=0.5.17 <0.9.0;


/**
* @notice Functions to be implemented by a hasValidKey Hook.
* @notice Functions to be implemented by a onKeyPurchaseHook Hook.
* @dev Lock hooks are configured by calling `setEventHooks` on the lock.
*/
interface ILockKeyTransferHook
Expand Down

0 comments on commit 349eb65

Please sign in to comment.